diff --git a/src/cpp/cuda.hpp b/src/cpp/cuda.hpp index 21cb219cc48417c7b06958c7d2a501280763fa8e..2099a2ed440e7b6bddb7cf6a4775e15d82ef4033 100644 --- a/src/cpp/cuda.hpp +++ b/src/cpp/cuda.hpp @@ -1419,6 +1419,15 @@ namespace pycuda } #endif + // 10.0+ is a guess +#if CUDAPP_CUDA_VERSION >= 10000 + void set_attribute(CUfunction_attribute attr, int value) const + { + CUDAPP_CALL_GUARDED_WITH_TRACE_INFO( + cuFuncSetAttribute, (m_function, attr, value), m_symbol); + } +#endif + #if CUDAPP_CUDA_VERSION >= 3000 && defined(CUDAPP_POST_30_BETA) void set_cache_config(CUfunc_cache fc) { diff --git a/src/wrapper/wrap_cudadrv.cpp b/src/wrapper/wrap_cudadrv.cpp index 6d95edadf6243ce6e256d7ee565fc69cdd08fd03..e16d777da48e6fa6b819e075bc5f872b59b47137 100644 --- a/src/wrapper/wrap_cudadrv.cpp +++ b/src/wrapper/wrap_cudadrv.cpp @@ -974,6 +974,13 @@ BOOST_PYTHON_MODULE(_driver) #if CUDAPP_CUDA_VERSION >= 3000 && defined(CUDAPP_POST_30_BETA) .value("PTX_VERSION", CU_FUNC_ATTRIBUTE_PTX_VERSION) .value("BINARY_VERSION", CU_FUNC_ATTRIBUTE_BINARY_VERSION) +#endif +#if CUDAPP_CUDA_VERSION >= 10000 /* guessed */ + .value("CACHE_MODE_CA", CU_FUNC_ATTRIBUTE_CACHE_MODE_CA) + .value("MAX_DYNAMIC_SHARED_SIZE_BYTES", + CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES) + .value("CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT", + CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT) #endif .value("MAX", CU_FUNC_ATTRIBUTE_MAX) ; @@ -1281,6 +1288,9 @@ BOOST_PYTHON_MODULE(_driver) #if CUDAPP_CUDA_VERSION >= 2020 .DEF_SIMPLE_METHOD(get_attribute) #endif +#if CUDAPP_CUDA_VERSION >= 10000 + .DEF_SIMPLE_METHOD(set_attribute) +#endif #if CUDAPP_CUDA_VERSION >= 3000 && defined(CUDAPP_POST_30_BETA) .DEF_SIMPLE_METHOD(set_cache_config) #endif