Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into msvc-support
Browse files Browse the repository at this point in the history
  • Loading branch information
jamievlin committed Feb 7, 2024
2 parents 28027e8 + 45126f4 commit f02755c
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 38 deletions.
2 changes: 1 addition & 1 deletion include/dec.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class dimensions : public absyn {
return depth;
}

types::array *truetype(types::ty *base);
types::array *truetype(types::ty *base, bool tacit=false);
};

class arrayTy : public ty {
Expand Down
5 changes: 3 additions & 2 deletions include/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ class protoenv {
bool add(symbol src, symbol dest,
protoenv &source, varEntry *qualifier, coder &c)
{
return te.add(src, dest, source.te, qualifier, c) ||
ve.add(src, dest, source.ve, qualifier, c);
bool teAdd=te.add(src, dest, source.te, qualifier, c);
bool veAdd=ve.add(src, dest, source.ve, qualifier, c);
return teAdd || veAdd;
}

// Add the standard functions for a new type.
Expand Down
31 changes: 11 additions & 20 deletions include/fftw++.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Fast Fourier transform C++ header class for the FFTW3 Library
Copyright (C) 2004-2022
Copyright (C) 2004-2024
John C. Bowman, University of Alberta
Malcolm Roberts, University of Strasbourg
Expand All @@ -20,7 +20,7 @@
#ifndef __fftwpp_h__
#define __fftwpp_h__ 1

#define __FFTWPP_H_VERSION__ 2.11
#define __FFTWPP_H_VERSION__ 3.01

#include <cstdlib>
#include <fstream>
Expand All @@ -44,11 +44,6 @@ typedef std::complex<double> Complex;

namespace fftwpp {

// Obsolete names:
#define FFTWComplex ComplexAlign
#define FFTWdouble doubleAlign
#define FFTWdelete deleteAlign

// Return the memory alignment used by FFTW.
// Use of this function requires applying patches/fftw-3.3.8-alignment.patch
// to the FFTW source, recompiling, and reinstalling the FFW library.
Expand Down Expand Up @@ -82,10 +77,6 @@ class ThreadBase
threads=1;
}
}

int get_thread_num0() {
return threads > 1 ? parallel::get_thread_num() : 0;
}
};

inline size_t realsize(size_t n, bool inplace)
Expand Down Expand Up @@ -527,9 +518,9 @@ struct keyless {
bool operator()(const keytype& a, const keytype& b) const {
return a.nx < b.nx || (a.nx == b.nx &&
(a.M < b.M || (a.M == b.M &&
(a.threads < b.threads ||
(a.threads == b.threads &&
a.inplace < b.inplace)))));
(a.threads < b.threads ||
(a.threads == b.threads &&
a.inplace < b.inplace)))));
}
};

Expand Down Expand Up @@ -983,9 +974,9 @@ class Mrcfft1d : public fftwblock<double,fftw_complex>,
init((Complex *) in,out,threads,threadtable);
}

void Normalize(Complex *out) {
fftw::Normalize<Complex>(nx/2+1,M,ostride,odist,out);
}
void Normalize(Complex *out) {
fftw::Normalize<Complex>(nx/2+1,M,ostride,odist,out);
}

void fftNormalized(double *in, Complex *out=NULL) {
fftw::fftNormalized<double,Complex>(nx/2+1,M,ostride,odist,in,out);
Expand Down Expand Up @@ -1081,9 +1072,9 @@ class Mcrfft1d : public fftwblock<fftw_complex,double>,
init(in,(Complex *) out,threads,threadtable);
}

void Normalize(double *out) {
fftw::Normalize<double>(nx,M,ostride,odist,out);
}
void Normalize(double *out) {
fftw::Normalize<double>(nx,M,ostride,odist,out);
}

void fftNormalized(Complex *in, double *out=NULL) {
fftw::fftNormalized<Complex,double>(nx,M,ostride,odist,in,out);
Expand Down
11 changes: 2 additions & 9 deletions include/seconds.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,10 @@ inline double cpuTime() {
#include <time.h>

inline double cpuTime() {
#ifdef CLOCK_THREAD_CPUTIME_ID
#define GETTIME_ID CLOCK_THREAD_CPUTIME_ID
#elif defined(CLOCK_PROCESS_CPUTIME_ID)
#define GETTIME_ID CLOCK_PROCESS_CPUTIME_ID
#endif

#ifdef GETTIME_ID
#ifdef CLOCK_PROCESS_CPUTIME_ID
timespec t;
clock_gettime(GETTIME_ID,&t);
clock_gettime(CLOCK_PROCESS_CPUTIME_ID,&t);
return 1.0e9*t.tv_sec+t.tv_nsec;
#undef GETTIME_ID
#else
struct rusage ru;
if(getrusage(RUSAGE_SELF, &ru))
Expand Down
11 changes: 6 additions & 5 deletions src/dec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ void dimensions::prettyprint(ostream &out, Int indent)
out << "dimensions (" << depth << ")\n";
}

types::array *dimensions::truetype(types::ty *base)
types::array *dimensions::truetype(types::ty *base, bool tacit)
{
if (base->kind == ty_void) {
if (!tacit && base->kind == ty_void) {
em.error(getPos());
em << "cannot declare array of type void";
}
Expand Down Expand Up @@ -109,7 +109,7 @@ types::ty *arrayTy::trans(coenv &e, bool tacit)
if (ct->kind == types::ty_error)
return ct;

types::array *t = dims->truetype(ct);
types::array *t = dims->truetype(ct,tacit);
assert(t);

return t;
Expand Down Expand Up @@ -386,9 +386,10 @@ trans::tyEntry *decidstart::getTyEntry(trans::tyEntry *base, coenv &e,
void decidstart::addOps(types::ty *base, coenv &e, record *r)
{
if (dims) {
e.e.addArrayOps(dims->truetype(base));
array *a=dims->truetype(base);
e.e.addArrayOps(a);
if (r)
r->e.addArrayOps(dims->truetype(base));
r->e.addArrayOps(a);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/glrender.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1859,7 +1859,7 @@ void init_osmesa()
OSMESA_DEPTH_BITS,16,
OSMESA_STENCIL_BITS,0,
OSMESA_ACCUM_BITS,0,
OSMESA_PROFILE,OSMESA_CORE_PROFILE,
OSMESA_PROFILE,OSMESA_COMPAT_PROFILE,
OSMESA_CONTEXT_MAJOR_VERSION,4,
OSMESA_CONTEXT_MINOR_VERSION,3,
0,0
Expand Down

0 comments on commit f02755c

Please sign in to comment.