flatironinstitute / cufinufft

Nonuniform fast Fourier transforms of types 1 and 2, in 1D, 2D, and 3D, on the GPU
Other
83 stars 18 forks source link

Thrust `max_element` header change #155

Open garrettwrong opened 8 months ago

garrettwrong commented 8 months ago

Building the latest master with the compilers below gave an error regarding a missing header.

Reporting this for posterity; already worked around. One line fix is below.

nvcc -DSINGLE --device-c -c -std=c++14 -ccbin=g++ -O3 -arch=sm_80 -gencode=arch=compute_80,code=sm_80 -Wno-deprecated-gpu-targets --default-stream per-thread -Xcompiler "-fPIC -O3 -funroll-loops -march=native -std=c++14" -I/usr/local/cuda/include -Icontrib/cuda_samples -I include test/fseries_kernel_test.cu -o test/fseries_kernel_test_32.o
src/precision_independent.cu(92): error: namespace "thrust" has no member "max_element"
   int *maxptsinbin = thrust::max_element(thrust::seq,
                              ^

1 error detected in the compilation of "src/precision_independent.cu".
make: *** [Makefile:112: src/precision_independent.o] Error 2
make: *** Waiting for unfinished jobs....
(/u/gbwright/.conda-envs/test_pacm3) ➜  cufinufft git:(master) ✗ gcc --version 
gcc (GCC) 11.3.1 20221121 (Red Hat 11.3.1-4)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

(/u/gbwright/.conda-envs/test_pacm3) ➜  cufinufft git:(master) ✗ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Aug_15_22:02:13_PDT_2023
Cuda compilation tools, release 12.2, V12.2.140
Build cuda_12.2.r12.2/compiler.33191640_0
(/u/gbwright/.conda-envs/test_pacm3) ➜  cufinufft git:(master) ✗ git diff | cat
diff --git a/src/precision_independent.cu b/src/precision_independent.cu
index 5351362..fa05303 100644
--- a/src/precision_independent.cu
+++ b/src/precision_independent.cu
@@ -5,6 +5,7 @@

 #include <thrust/device_ptr.h>
 #include <thrust/scan.h>
+#include <thrust/extrema.h>
 #include <cuComplex.h>

 #include "precision_independent.h"
janden commented 8 months ago

Thanks! Will see if this pops up in the merged codebase as well.