Skip to content

Commit 38fcde8

Browse files
committed
constrain CUDA version for cuFuncSetAttribute
1 parent 38a3096 commit 38fcde8

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

cupy/cuda/cupy_cuda.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ extern "C" {
2222

2323
#if CUDA_VERSION < 9000
2424

25+
CUresult cuFuncSetAttribute(...) {
26+
return CUDA_ERROR_NOT_SUPPORTED;
27+
}
28+
2529
typedef enum {} cublasMath_t;
2630

2731
cublasStatus_t cublasSetMathMode(...) {

cupy/cuda/driver.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ cpdef int funcGetAttribute(int attribute, intptr_t f):
256256

257257

258258
cpdef funcSetAttribute(intptr_t f, int attribute, int value):
259+
if CUDA_VERSION < 9000:
260+
raise RuntimeError("Your CUDA does not support cuFuncSetAttribute.")
259261
with nogil:
260262
status = cuFuncSetAttribute(
261263
<Function> f,

0 commit comments

Comments
 (0)