mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Summary: Make `TORCH_CUDABLAS_CHECK` and `TORCH_CUSOLVER_CHECK` available in custom extensions by exporting the internal functions called by the both macros. Rel: https://github.com/pytorch/pytorch/issues/67073 cc xwang233 ptrblck Pull Request resolved: https://github.com/pytorch/pytorch/pull/67161 Reviewed By: jbschlosser Differential Revision: D31984694 Pulled By: ngimel fbshipit-source-id: 0035ecd1398078cf7d3abc23aaefda57aaa31106
18 lines
424 B
C++
18 lines
424 B
C++
#include <torch/extension.h>
|
|
#include <ATen/cuda/CUDAContext.h>
|
|
|
|
#include <cusolverDn.h>
|
|
|
|
|
|
torch::Tensor noop_cusolver_function(torch::Tensor x) {
|
|
cusolverDnHandle_t handle;
|
|
TORCH_CUSOLVER_CHECK(cusolverDnCreate(&handle));
|
|
TORCH_CUSOLVER_CHECK(cusolverDnDestroy(handle));
|
|
return x;
|
|
}
|
|
|
|
|
|
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
|
|
m.def("noop_cusolver_function", &noop_cusolver_function, "a cusolver function");
|
|
}
|