From 7c21c470b740e91e06cef1503d353727489880d1 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 16 Feb 2022 10:38:21 -0600 Subject: [PATCH] Document, fix Function.set_attribute, added function attributes --- doc/driver.rst | 25 ++++++++++++++++++++++--- src/wrapper/wrap_cudadrv.cpp | 2 +- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/doc/driver.rst b/doc/driver.rst index 6a690ed6..6e6d65f5 100644 --- a/doc/driver.rst +++ b/doc/driver.rst @@ -331,7 +331,7 @@ Constants CUDA 6.0 and above. .. versionadded:: 2014.1 - + .. attribute :: HOST_NATIVE_ATOMIC_SUPPORTED SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO PAGEABLE_MEMORY_ACCESS @@ -409,6 +409,18 @@ Constants .. versionadded:: 0.94 + .. attribute:: CACHE_MODE_CA + + .. versionadded:: 2022.1 + + .. attribute:: MAX_DYNAMIC_SHARED_SIZE_BYTES + + .. versionadded:: 2022.1 + + .. attribute:: PREFERRED_SHARED_MEMORY_CARVEOUT + + .. versionadded:: 2022.1 + .. attribute:: MAX .. class:: func_cache @@ -1853,9 +1865,9 @@ Code on the Device: Modules and Functions which can make it somewhat slow. For a kernel that is invoked often, this can be inconvenient. For a faster (but mildly less convenient) way of invoking kernels, see :meth:`prepare` and :meth:`prepared_call`. - + .. note:: - + *grid* with more than two dimensions requires CUDA 4.0 or newer. .. method:: param_set_texref(texref) @@ -1932,6 +1944,13 @@ Code on the Device: Modules and Functions .. versionadded:: 0.93 + .. method:: set_attribute(attr, value) + + Set one of the (settable) attributes given by the + :class:`function_attribute` value *attr* to *value*. + + .. versionadded:: 2022.1 + .. attribute:: set_cache_config(fc) See :class:`func_cache` for possible values of *fc*. diff --git a/src/wrapper/wrap_cudadrv.cpp b/src/wrapper/wrap_cudadrv.cpp index 457820a6..01f09189 100644 --- a/src/wrapper/wrap_cudadrv.cpp +++ b/src/wrapper/wrap_cudadrv.cpp @@ -979,7 +979,7 @@ BOOST_PYTHON_MODULE(_driver) .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", + .value("PREFERRED_SHARED_MEMORY_CARVEOUT", CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT) #endif .value("MAX", CU_FUNC_ATTRIBUTE_MAX) -- GitLab