-
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.
Replacing pybind11 with nanobind (#83)
* Replacing pybind11 with nanobind * removing extra unused namespace * build: nanobind doesn't enable LTO by default, no need to globally disable * Including @lgarrison's suggestion --------- Co-authored-by: Lehman Garrison <[email protected]>
- Loading branch information
Showing
8 changed files
with
139 additions
and
159 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
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,28 @@ | ||
// This header extends kernel_helpers.h with the nanobind specific interface to | ||
// serializing descriptors. It also adds a nanobind function for wrapping our | ||
// custom calls in a Python capsule. This is separate from kernel_helpers so that | ||
// the CUDA code itself doesn't include nanobind. I don't think that this is | ||
// strictly necessary, but they do it in jaxlib, so let's do it here too. | ||
|
||
#ifndef _JAX_FINUFFT_NANOBIND_KERNEL_HELPERS_H_ | ||
#define _JAX_FINUFFT_NANOBIND_KERNEL_HELPERS_H_ | ||
|
||
#include <nanobind/nanobind.h> | ||
|
||
#include "kernel_helpers.h" | ||
|
||
namespace jax_finufft { | ||
|
||
template <typename T> | ||
nanobind::bytes pack_descriptor(const T& descriptor) { | ||
return nanobind::bytes(bit_cast<const char*>(&descriptor), sizeof(T)); | ||
} | ||
|
||
template <typename T> | ||
nanobind::capsule encapsulate_function(T* fn) { | ||
return nanobind::capsule(bit_cast<void*>(fn), "xla._CUSTOM_CALL_TARGET"); | ||
} | ||
|
||
} // 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
Oops, something went wrong.