-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding CPU options struct * don't export enum values * getting CPU opts working * naming issue * moving options building to python via pydantic * getting opts implemented * gpu bugs * more bugs * bugz bugz * adding options tests * fixing variable name * moving include of descriptor * includes * lib: put cufinufft wrapper function declarations in their own header file * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * lib: need to declare template specialization in header --------- Co-authored-by: Lehman Garrison <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
672247e
commit ef69daa
Showing
16 changed files
with
469 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#ifndef _CUFINUFFT_WRAPPER_H_ | ||
#define _CUFINUFFT_WRAPPER_H_ | ||
|
||
#include <complex> | ||
|
||
#include "cufinufft.h" | ||
|
||
namespace jax_finufft { | ||
|
||
namespace gpu { | ||
|
||
template <typename T> | ||
struct plan_type; | ||
|
||
template <> | ||
struct plan_type<double> { | ||
typedef cufinufft_plan type; | ||
}; | ||
|
||
template <> | ||
struct plan_type<float> { | ||
typedef cufinufftf_plan type; | ||
}; | ||
|
||
template <typename T> | ||
void default_opts(cufinufft_opts* opts); | ||
|
||
template <typename T> | ||
void update_opts(cufinufft_opts* opts, int dim, cudaStream_t stream); | ||
|
||
template <typename T> | ||
int makeplan(int type, int dim, const int64_t nmodes[3], int iflag, int ntr, T eps, | ||
typename plan_type<T>::type* plan, cufinufft_opts* opts); | ||
|
||
template <typename T> | ||
int setpts(typename plan_type<T>::type plan, int64_t M, T* x, T* y, T* z, int64_t N, T* s, T* t, | ||
T* u); | ||
|
||
template <typename T> | ||
int execute(typename plan_type<T>::type plan, std::complex<T>* c, std::complex<T>* f); | ||
|
||
template <typename T> | ||
void destroy(typename plan_type<T>::type plan); | ||
|
||
template <int ndim, typename T> | ||
T* y_index(T* y, int64_t index) { | ||
return &(y[index]); | ||
} | ||
|
||
template <int ndim, typename T> | ||
T* z_index(T* z, int64_t index) { | ||
return NULL; | ||
} | ||
|
||
template <> | ||
double* y_index<1, double>(double* y, int64_t index); | ||
|
||
template <> | ||
float* y_index<1, float>(float* y, int64_t index); | ||
|
||
template <> | ||
double* z_index<3, double>(double* z, int64_t index); | ||
|
||
template <> | ||
float* z_index<3, float>(float* z, int64_t index); | ||
|
||
} // namespace gpu | ||
|
||
} // namespace jax_finufft | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.