From adf64b2d2378e6711e18d6efe4199ca66d0cb056 Mon Sep 17 00:00:00 2001 From: Vladislav Zhurba Date: Fri, 11 Oct 2024 13:09:21 -0700 Subject: [PATCH] Apply remaining touch ups for patch release - Issue #102: Rename root cuda to cuda_bindings - Issue #145: Explain layout change - Issue #108: Resolve how to run editable builds --- cuda/cuda/bindings/_bindings/loader.cpp | 354 ------------------ cuda/cuda/bindings/_lib/param_packer.cpp | 163 -------- cuda/cuda/bindings/benchmarks/__init__.py | 0 cuda/cuda/bindings/examples/__init__.py | 0 cuda/cuda/bindings/examples/setup.cfg | 3 - cuda/cuda/bindings/tests/__init__.py | 0 {cuda => cuda_bindings}/LICENSE | 0 {cuda => cuda_bindings}/MANIFEST.in | 0 {cuda => cuda_bindings}/README.md | 6 +- .../benchmarks/kernels.py | 0 .../benchmarks/perf_test_utils.py | 0 {cuda => cuda_bindings/benchmarks}/pytest.ini | 1 - .../benchmarks/test_cupy.py | 0 .../benchmarks/test_launch_latency.py | 0 .../benchmarks/test_numba.py | 0 .../benchmarks/test_pointer_attributes.py | 0 {cuda => cuda_bindings}/cuda/__init__.pxd | 0 {cuda => cuda_bindings}/cuda/__init__.py | 0 .../cuda/bindings/__init__.pxd | 0 .../cuda/bindings/__init__.py | 0 .../cuda/bindings/_bindings/__init__.py | 0 .../cuda/bindings/_bindings/cydriver.pxd.in | 0 .../cuda/bindings/_bindings/cydriver.pyx.in | 0 .../cuda/bindings/_bindings/cynvrtc.pxd.in | 0 .../cuda/bindings/_bindings/cynvrtc.pyx.in | 0 .../cuda/bindings/_bindings/loader.h | 0 .../cuda/bindings/_bindings/loader.pxd | 0 .../cuda/bindings/_lib/__init__.py | 0 .../cuda/bindings/_lib/cyruntime/__init__.py | 0 .../bindings/_lib/cyruntime/cyruntime.pxd.in | 0 .../bindings/_lib/cyruntime/cyruntime.pyx.in | 0 .../cuda/bindings/_lib/cyruntime/utils.pxd.in | 0 .../cuda/bindings/_lib/cyruntime/utils.pyx.in | 0 .../cuda/bindings/_lib/dlfcn.pxd | 0 .../cuda/bindings/_lib/param_packer.h | 0 .../cuda/bindings/_lib/param_packer.pxd | 0 .../cuda/bindings/_lib/utils.pxd.in | 0 .../cuda/bindings/_lib/utils.pyx.in | 0 .../cuda/bindings/_version.py | 0 .../cuda/bindings/cydriver.pxd.in | 0 .../cuda/bindings/cydriver.pyx.in | 0 .../cuda/bindings/cynvrtc.pxd.in | 0 .../cuda/bindings/cynvrtc.pyx.in | 0 .../cuda/bindings/cyruntime.pxd.in | 0 .../cuda/bindings/cyruntime.pyx.in | 0 .../cuda/bindings/driver.pxd.in | 0 .../cuda/bindings/driver.pyx.in | 0 .../cuda/bindings/nvrtc.pxd.in | 0 .../cuda/bindings/nvrtc.pyx.in | 0 .../cuda/bindings/runtime.pxd.in | 0 .../cuda/bindings/runtime.pyx.in | 0 {cuda => cuda_bindings}/cuda/ccuda.pxd | 0 {cuda => cuda_bindings}/cuda/ccuda.pyx | 0 {cuda => cuda_bindings}/cuda/ccudart.pxd | 0 {cuda => cuda_bindings}/cuda/ccudart.pyx | 0 {cuda => cuda_bindings}/cuda/cnvrtc.pxd | 0 {cuda => cuda_bindings}/cuda/cnvrtc.pyx | 0 {cuda => cuda_bindings}/cuda/cuda.pyx | 0 {cuda => cuda_bindings}/cuda/cudart.pyx | 0 {cuda => cuda_bindings}/cuda/nvrtc.pyx | 0 .../0_Introduction/clock_nvrtc_test.py | 6 +- .../simpleCubemapTexture_test.py | 6 +- .../examples/0_Introduction/simpleP2P_test.py | 6 +- .../0_Introduction/simpleZeroCopy_test.py | 8 +- .../0_Introduction/systemWideAtomics_test.py | 6 +- .../0_Introduction/vectorAddDrv_test.py | 6 +- .../0_Introduction/vectorAddMMAP_test.py | 6 +- .../streamOrderedAllocation_test.py | 8 +- .../globalToShmemAsyncCopy_test.py | 8 +- .../3_CUDA_Features/simpleCudaGraphs_test.py | 6 +- .../conjugateGradientMultiBlockCG_test.py | 6 +- .../examples/common/common.py | 4 +- .../examples/common/helper_cuda.py | 4 +- .../examples/common/helper_string.py | 2 +- .../examples/extra/isoFDModelling_test.py | 4 +- .../examples/extra/jit_program_test.py | 0 .../examples/extra/numba_emm_plugin.py | 0 cuda_bindings/examples/pytest.ini | 4 + {cuda => cuda_bindings}/pyproject.toml | 0 {cuda => cuda_bindings}/requirements.txt | 0 {cuda => cuda_bindings}/setup.py | 10 +- .../tests/test_ccuda.pyx | 0 .../tests/test_ccudart.pyx | 0 .../tests/test_cuda.py | 0 .../tests/test_cudart.py | 0 .../tests/test_cython.py | 8 +- .../tests/test_interoperability.py | 0 .../tests/test_interoperability_cython.pyx | 0 .../tests/test_kernelParams.py | 0 .../tests/test_nvrtc.py | 0 90 files changed, 61 insertions(+), 574 deletions(-) delete mode 100644 cuda/cuda/bindings/_bindings/loader.cpp delete mode 100644 cuda/cuda/bindings/_lib/param_packer.cpp delete mode 100644 cuda/cuda/bindings/benchmarks/__init__.py delete mode 100644 cuda/cuda/bindings/examples/__init__.py delete mode 100644 cuda/cuda/bindings/examples/setup.cfg delete mode 100644 cuda/cuda/bindings/tests/__init__.py rename {cuda => cuda_bindings}/LICENSE (100%) rename {cuda => cuda_bindings}/MANIFEST.in (100%) rename {cuda => cuda_bindings}/README.md (96%) rename {cuda/cuda/bindings => cuda_bindings}/benchmarks/kernels.py (100%) rename {cuda/cuda/bindings => cuda_bindings}/benchmarks/perf_test_utils.py (100%) rename {cuda => cuda_bindings/benchmarks}/pytest.ini (84%) rename {cuda/cuda/bindings => cuda_bindings}/benchmarks/test_cupy.py (100%) rename {cuda/cuda/bindings => cuda_bindings}/benchmarks/test_launch_latency.py (100%) rename {cuda/cuda/bindings => cuda_bindings}/benchmarks/test_numba.py (100%) rename {cuda/cuda/bindings => cuda_bindings}/benchmarks/test_pointer_attributes.py (100%) rename {cuda => cuda_bindings}/cuda/__init__.pxd (100%) rename {cuda => cuda_bindings}/cuda/__init__.py (100%) rename {cuda => cuda_bindings}/cuda/bindings/__init__.pxd (100%) rename {cuda => cuda_bindings}/cuda/bindings/__init__.py (100%) rename {cuda => cuda_bindings}/cuda/bindings/_bindings/__init__.py (100%) rename {cuda => cuda_bindings}/cuda/bindings/_bindings/cydriver.pxd.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/_bindings/cydriver.pyx.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/_bindings/cynvrtc.pxd.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/_bindings/cynvrtc.pyx.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/_bindings/loader.h (100%) rename {cuda => cuda_bindings}/cuda/bindings/_bindings/loader.pxd (100%) rename {cuda => cuda_bindings}/cuda/bindings/_lib/__init__.py (100%) rename {cuda => cuda_bindings}/cuda/bindings/_lib/cyruntime/__init__.py (100%) rename {cuda => cuda_bindings}/cuda/bindings/_lib/cyruntime/cyruntime.pxd.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/_lib/cyruntime/cyruntime.pyx.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/_lib/cyruntime/utils.pxd.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/_lib/cyruntime/utils.pyx.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/_lib/dlfcn.pxd (100%) rename {cuda => cuda_bindings}/cuda/bindings/_lib/param_packer.h (100%) rename {cuda => cuda_bindings}/cuda/bindings/_lib/param_packer.pxd (100%) rename {cuda => cuda_bindings}/cuda/bindings/_lib/utils.pxd.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/_lib/utils.pyx.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/_version.py (100%) rename {cuda => cuda_bindings}/cuda/bindings/cydriver.pxd.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/cydriver.pyx.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/cynvrtc.pxd.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/cynvrtc.pyx.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/cyruntime.pxd.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/cyruntime.pyx.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/driver.pxd.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/driver.pyx.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/nvrtc.pxd.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/nvrtc.pyx.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/runtime.pxd.in (100%) rename {cuda => cuda_bindings}/cuda/bindings/runtime.pyx.in (100%) rename {cuda => cuda_bindings}/cuda/ccuda.pxd (100%) rename {cuda => cuda_bindings}/cuda/ccuda.pyx (100%) rename {cuda => cuda_bindings}/cuda/ccudart.pxd (100%) rename {cuda => cuda_bindings}/cuda/ccudart.pyx (100%) rename {cuda => cuda_bindings}/cuda/cnvrtc.pxd (100%) rename {cuda => cuda_bindings}/cuda/cnvrtc.pyx (100%) rename {cuda => cuda_bindings}/cuda/cuda.pyx (100%) rename {cuda => cuda_bindings}/cuda/cudart.pyx (100%) rename {cuda => cuda_bindings}/cuda/nvrtc.pyx (100%) rename {cuda/cuda/bindings => cuda_bindings}/examples/0_Introduction/clock_nvrtc_test.py (93%) rename {cuda/cuda/bindings => cuda_bindings}/examples/0_Introduction/simpleCubemapTexture_test.py (97%) rename {cuda/cuda/bindings => cuda_bindings}/examples/0_Introduction/simpleP2P_test.py (97%) rename {cuda/cuda/bindings => cuda_bindings}/examples/0_Introduction/simpleZeroCopy_test.py (95%) rename {cuda/cuda/bindings => cuda_bindings}/examples/0_Introduction/systemWideAtomics_test.py (97%) rename {cuda/cuda/bindings => cuda_bindings}/examples/0_Introduction/vectorAddDrv_test.py (94%) rename {cuda/cuda/bindings => cuda_bindings}/examples/0_Introduction/vectorAddMMAP_test.py (98%) rename {cuda/cuda/bindings => cuda_bindings}/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py (96%) rename {cuda/cuda/bindings => cuda_bindings}/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py (99%) rename {cuda/cuda/bindings => cuda_bindings}/examples/3_CUDA_Features/simpleCudaGraphs_test.py (98%) rename {cuda/cuda/bindings => cuda_bindings}/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py (98%) rename {cuda/cuda/bindings => cuda_bindings}/examples/common/common.py (94%) rename {cuda/cuda/bindings => cuda_bindings}/examples/common/helper_cuda.py (90%) rename {cuda/cuda/bindings => cuda_bindings}/examples/common/helper_string.py (91%) rename {cuda/cuda/bindings => cuda_bindings}/examples/extra/isoFDModelling_test.py (99%) rename {cuda/cuda/bindings => cuda_bindings}/examples/extra/jit_program_test.py (100%) rename {cuda/cuda/bindings => cuda_bindings}/examples/extra/numba_emm_plugin.py (100%) create mode 100644 cuda_bindings/examples/pytest.ini rename {cuda => cuda_bindings}/pyproject.toml (100%) rename {cuda => cuda_bindings}/requirements.txt (100%) rename {cuda => cuda_bindings}/setup.py (96%) rename {cuda/cuda/bindings => cuda_bindings}/tests/test_ccuda.pyx (100%) rename {cuda/cuda/bindings => cuda_bindings}/tests/test_ccudart.pyx (100%) rename {cuda/cuda/bindings => cuda_bindings}/tests/test_cuda.py (100%) rename {cuda/cuda/bindings => cuda_bindings}/tests/test_cudart.py (100%) rename {cuda/cuda/bindings => cuda_bindings}/tests/test_cython.py (80%) rename {cuda/cuda/bindings => cuda_bindings}/tests/test_interoperability.py (100%) rename {cuda/cuda/bindings => cuda_bindings}/tests/test_interoperability_cython.pyx (100%) rename {cuda/cuda/bindings => cuda_bindings}/tests/test_kernelParams.py (100%) rename {cuda/cuda/bindings => cuda_bindings}/tests/test_nvrtc.py (100%) diff --git a/cuda/cuda/bindings/_bindings/loader.cpp b/cuda/cuda/bindings/_bindings/loader.cpp deleted file mode 100644 index b2477fef..00000000 --- a/cuda/cuda/bindings/_bindings/loader.cpp +++ /dev/null @@ -1,354 +0,0 @@ -// Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -// -// Please refer to the NVIDIA end user license agreement (EULA) associated -// with this source code for terms and conditions that govern your use of -// this software. Any use, reproduction, disclosure, or distribution of -// this software and related documentation outside the terms of the EULA -// is strictly prohibited. -#include -#include -#include -#include "loader.h" - -#define DXCORE_MAX_PATH 260 - -#if defined(_WIN32) -#include "windows.h" -#define _getAddr GetProcAddress -#define _Handle HMODULE -static const size_t sysrootName64_length = (sizeof("System32") - 1); -static const char* sysrootName64 = "System32"; -static const size_t libcudaName64_length = (sizeof("\\nvcuda64.dll") - 1); -static const char* libcudaName64 = "\\nvcuda64.dll"; -static const size_t sysrootNameX86_length = (sizeof("SysWOW64") - 1); -static const char* sysrootNameX86 = "SysWOW64"; -static const size_t libcudaNameX86_length = (sizeof("\\nvcuda32.dll") - 1); -static const char* libcudaNameX86 = "\\nvcuda32.dll"; -static size_t sysrootName_length = NULL; -static const char* sysrootName = NULL; - -#else -#include -#include -#define _getAddr dlsym -#define _Handle void* -static const size_t libcudaNameLinux_length = (sizeof("/libcuda.so.1.1") - 1); -static const char* libcudaNameLinux = "/libcuda.so.1.1"; -#endif -static size_t libcudaName_length = 0; -static const char* libcudaName = NULL; - -struct dxcore_enumAdapters2; -struct dxcore_queryAdapterInfo; - -typedef int (*pfnDxcoreEnumAdapters2)(const dxcore_enumAdapters2 *pParams); -typedef int (*pfnDxcoreQueryAdapterInfo)(const dxcore_queryAdapterInfo *pParams); - -struct dxcore_lib { - _Handle hDxcoreLib; - pfnDxcoreEnumAdapters2 pDxcoreEnumAdapters2; - pfnDxcoreQueryAdapterInfo pDxcoreQueryAdapterInfo; -}; - -struct dxcore_luid -{ - unsigned int lowPart; - int highPart; -}; - -struct dxcore_adapterInfo -{ - unsigned int hAdapter; - struct dxcore_luid AdapterLuid; - unsigned int NumOfSources; - unsigned int bPresentMoveRegionsPreferred; -}; - -struct dxcore_enumAdapters2 -{ - unsigned int NumAdapters; - struct dxcore_adapterInfo *pAdapters; -}; - -enum dxcore_kmtqueryAdapterInfoType -{ - DXCORE_QUERYDRIVERVERSION = 13, - DXCORE_QUERYREGISTRY = 48, -}; - -enum dxcore_queryregistry_type { - DXCORE_QUERYREGISTRY_DRIVERSTOREPATH = 2, -}; - -enum dxcore_queryregistry_status { - DXCORE_QUERYREGISTRY_STATUS_SUCCESS = 0, - DXCORE_QUERYREGISTRY_STATUS_BUFFER_OVERFLOW = 1, - DXCORE_QUERYREGISTRY_STATUS_FAIL = 2, -}; - -struct dxcore_queryregistry_info { - enum dxcore_queryregistry_type QueryType; - unsigned int QueryFlags; - wchar_t ValueName[DXCORE_MAX_PATH]; - unsigned int ValueType; - unsigned int PhysicalAdapterIndex; - unsigned int OutputValueSize; - enum dxcore_queryregistry_status Status; - union { - unsigned long long OutputQword; - wchar_t Output; - }; -}; - -struct dxcore_queryAdapterInfo -{ - unsigned int hAdapter; - enum dxcore_kmtqueryAdapterInfoType Type; - void *pPrivateDriverData; - unsigned int PrivateDriverDataSize; -}; - -static int dxcore_query_adapter_info_helper(struct dxcore_lib* pLib, - unsigned int hAdapter, - enum dxcore_kmtqueryAdapterInfoType type, - void* pPrivateDriverDate, - unsigned int privateDriverDataSize) -{ - struct dxcore_queryAdapterInfo queryAdapterInfo = {}; - - queryAdapterInfo.hAdapter = hAdapter; - queryAdapterInfo.Type = type; - queryAdapterInfo.pPrivateDriverData = pPrivateDriverDate; - queryAdapterInfo.PrivateDriverDataSize = privateDriverDataSize; - - return pLib->pDxcoreQueryAdapterInfo(&queryAdapterInfo); -} - -static int dxcore_query_adapter_wddm_version(struct dxcore_lib* pLib, unsigned int hAdapter, unsigned int* version) -{ - return dxcore_query_adapter_info_helper(pLib, - hAdapter, - DXCORE_QUERYDRIVERVERSION, - (void*)version, - (unsigned int)sizeof(*version)); -} - -static int dxcore_query_adapter_driverstore_path(struct dxcore_lib* pLib, unsigned int hAdapter, char** ppDriverStorePath) -{ - struct dxcore_queryregistry_info params = {}; - struct dxcore_queryregistry_info* pValue = NULL; - wchar_t* pOutput; - size_t outputSizeInBytes; - size_t outputSize; - - // 1. Fetch output size - params.QueryType = DXCORE_QUERYREGISTRY_DRIVERSTOREPATH; - - if (dxcore_query_adapter_info_helper(pLib, - hAdapter, - DXCORE_QUERYREGISTRY, - (void*)¶ms, - (unsigned int)sizeof(struct dxcore_queryregistry_info))) - { - return (-1); - } - - if (params.OutputValueSize > DXCORE_MAX_PATH * sizeof(wchar_t)) { - return (-1); - } - - outputSizeInBytes = (size_t)params.OutputValueSize; - outputSize = outputSizeInBytes / sizeof(wchar_t); - - // 2. Retrieve output - pValue = (struct dxcore_queryregistry_info*)calloc(sizeof(struct dxcore_queryregistry_info) + outputSizeInBytes + sizeof(wchar_t), 1); - if (!pValue) { - return (-1); - } - - pValue->QueryType = DXCORE_QUERYREGISTRY_DRIVERSTOREPATH; - pValue->OutputValueSize = (unsigned int)outputSizeInBytes; - - if (dxcore_query_adapter_info_helper(pLib, - hAdapter, - DXCORE_QUERYREGISTRY, - (void*)pValue, - (unsigned int)(sizeof(struct dxcore_queryregistry_info) + outputSizeInBytes))) - { - free(pValue); - return (-1); - } - pOutput = (wchar_t*)(&pValue->Output); - - // Make sure no matter what happened the wchar_t string is null terminated - pOutput[outputSize] = L'\0'; - - // Convert the output into a regular c string - *ppDriverStorePath = (char*)calloc(outputSize + 1, sizeof(char)); - if (!*ppDriverStorePath) { - free(pValue); - return (-1); - } - wcstombs(*ppDriverStorePath, pOutput, outputSize); - - free(pValue); - - return 0; -} - -static char* replaceSystemPath(char* path) -{ - char *replacedPath = (char*)calloc(DXCORE_MAX_PATH + 1, sizeof(char)); - -#if defined(_WIN32) - wchar_t *systemPath = (wchar_t*)calloc(DXCORE_MAX_PATH + 1, sizeof(wchar_t)); - // Get system root path - if (GetSystemDirectoryW(systemPath, DXCORE_MAX_PATH) == 0) { - free(replacedPath); - free(systemPath); - return NULL; - } - wcstombs(replacedPath, systemPath, DXCORE_MAX_PATH); - free(systemPath); - - // Replace the /SystemRoot/ part of the registry-obtained path with - // the actual system root path from above - char* sysrootPath = strstr(path, sysrootName); - strncat(replacedPath, sysrootPath + sysrootName_length, DXCORE_MAX_PATH - strlen(replacedPath)); -#else - strncat(replacedPath, path, DXCORE_MAX_PATH); -#endif - - // Append nvcuda dll - if (libcudaName_length < DXCORE_MAX_PATH - strlen(replacedPath)) { - strncat(replacedPath, libcudaName, libcudaName_length); - } - else { - strncat(replacedPath, libcudaName, DXCORE_MAX_PATH - strlen(replacedPath)); - } - - return replacedPath; -} - -static int dxcore_check_adapter(struct dxcore_lib *pLib, char *libPath, struct dxcore_adapterInfo *pAdapterInfo) -{ - unsigned int wddmVersion = 0; - char* driverStorePath = NULL; - - if (dxcore_query_adapter_wddm_version(pLib, pAdapterInfo->hAdapter, &wddmVersion)) { - return 1; - } - - if (wddmVersion < 2500) { - return 1; - } - - if (dxcore_query_adapter_driverstore_path(pLib, pAdapterInfo->hAdapter, &driverStorePath)) { - return 1; - } - - // Replace with valid path - char* replacedPath = replaceSystemPath(driverStorePath); - if (!replacedPath) { - free(driverStorePath); - free(replacedPath); - return 1; - } - - // Does file exist? -#if defined(_WIN32) - if (GetFileAttributes(replacedPath) == INVALID_FILE_ATTRIBUTES) { - free(driverStorePath); - free(replacedPath); - return 1; - } -#else - if (access(replacedPath, F_OK) < 0) { - free(driverStorePath); - free(replacedPath); - return 1; - } -#endif - - memcpy(libPath, replacedPath, DXCORE_MAX_PATH); - free(driverStorePath); - free(replacedPath); - - return 0; -} - -static int dxcore_enum_adapters(struct dxcore_lib *pLib, char *libPath) -{ - struct dxcore_enumAdapters2 params = {0}; - unsigned int adapterIndex = 0; - - if (pLib->pDxcoreEnumAdapters2(¶ms)) { - return 1; - } - params.pAdapters = (dxcore_adapterInfo*)calloc(params.NumAdapters, sizeof(struct dxcore_adapterInfo)); - if (pLib->pDxcoreEnumAdapters2(¶ms)) { - free(params.pAdapters); - return 1; - } - - for (adapterIndex = 0; adapterIndex < params.NumAdapters; adapterIndex++) { - if (!dxcore_check_adapter(pLib, libPath, ¶ms.pAdapters[adapterIndex])) { - free(params.pAdapters); - return 0; - } - } - - free(params.pAdapters); - return 1; -} - -int getCUDALibraryPath(char *libPath, bool isBit64) -{ - struct dxcore_lib lib = {0}; - - if (!libPath) { - return 1; - } - - // Configure paths based on app's bit configuration -#if defined(_WIN32) - if (isBit64) { - sysrootName_length = sysrootName64_length; - sysrootName = sysrootName64; - libcudaName_length = libcudaName64_length; - libcudaName = libcudaName64; - } - else { - sysrootName_length = sysrootNameX86_length; - sysrootName = sysrootNameX86; - libcudaName_length = libcudaNameX86_length; - libcudaName = libcudaNameX86; - } -#else - libcudaName_length = libcudaNameLinux_length; - libcudaName = libcudaNameLinux; -#endif - -#if defined(_WIN32) - lib.hDxcoreLib = LoadLibraryExW(L"gdi32.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32); -#else - lib.hDxcoreLib = dlopen("libdxcore.so", RTLD_LAZY); -#endif - if (!lib.hDxcoreLib) { - return 1; - } - - lib.pDxcoreEnumAdapters2 = (pfnDxcoreEnumAdapters2)_getAddr(lib.hDxcoreLib, "D3DKMTEnumAdapters2"); - if (!lib.pDxcoreEnumAdapters2) { - return 1; - } - lib.pDxcoreQueryAdapterInfo = (pfnDxcoreQueryAdapterInfo)_getAddr(lib.hDxcoreLib, "D3DKMTQueryAdapterInfo"); - if (!lib.pDxcoreQueryAdapterInfo) { - return 1; - } - - if (dxcore_enum_adapters(&lib, libPath)) { - return 1; - } - return 0; -} diff --git a/cuda/cuda/bindings/_lib/param_packer.cpp b/cuda/cuda/bindings/_lib/param_packer.cpp deleted file mode 100644 index 63386a17..00000000 --- a/cuda/cuda/bindings/_lib/param_packer.cpp +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -// -// Please refer to the NVIDIA end user license agreement (EULA) associated -// with this source code for terms and conditions that govern your use of -// this software. Any use, reproduction, disclosure, or distribution of -// this software and related documentation outside the terms of the EULA -// is strictly prohibited. -#include -#include "param_packer.h" - -#include -#include -#include -#include - -PyObject* enum_module = nullptr; -PyTypeObject* enum_Enum = nullptr; - -PyObject* ctypes_module = nullptr; -PyObject* ctypes_addressof = nullptr; -PyObject* addressof_param_tuple = nullptr; - -PyTypeObject* ctypes_c_char = nullptr; -PyTypeObject* ctypes_c_bool = nullptr; -PyTypeObject* ctypes_c_wchar = nullptr; -PyTypeObject* ctypes_c_byte = nullptr; -PyTypeObject* ctypes_c_ubyte = nullptr; -PyTypeObject* ctypes_c_short = nullptr; -PyTypeObject* ctypes_c_ushort = nullptr; -PyTypeObject* ctypes_c_int = nullptr; -PyTypeObject* ctypes_c_uint = nullptr; -PyTypeObject* ctypes_c_long = nullptr; -PyTypeObject* ctypes_c_ulong = nullptr; -PyTypeObject* ctypes_c_longlong = nullptr; -PyTypeObject* ctypes_c_ulonglong = nullptr; -PyTypeObject* ctypes_c_size_t = nullptr; -PyTypeObject* ctypes_c_float = nullptr; -PyTypeObject* ctypes_c_double = nullptr; -PyTypeObject* ctypes_c_void_p = nullptr; - -PyTypeObject* ctypes_c_ssize_t = nullptr; -PyTypeObject* ctypes_c_longdouble = nullptr; -PyTypeObject* ctypes_c_char_p = nullptr; -PyTypeObject* ctypes_c_wchar_p = nullptr; -PyTypeObject* ctypes_c_structure = nullptr; - -void fetch_ctypes() -{ - ctypes_module = PyImport_ImportModule("ctypes"); - if (ctypes_module == nullptr) - throw std::runtime_error("Cannot import ctypes module"); - // get method addressof - PyObject* ctypes_dict = PyModule_GetDict(ctypes_module); - if (ctypes_dict == nullptr) - throw std::runtime_error(std::string("FAILURE @ ") + std::string(__FILE__) + " : " + std::to_string(__LINE__)); - // supportedtypes - ctypes_c_int = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_int"); - ctypes_c_char = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_char"); - ctypes_c_bool = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_bool"); - ctypes_c_wchar = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_wchar"); - ctypes_c_byte = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_byte"); - ctypes_c_ubyte = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ubyte"); - ctypes_c_short = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_short"); - ctypes_c_ushort = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ushort"); - ctypes_c_int = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_int"); - ctypes_c_uint = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_uint"); - ctypes_c_long = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_long"); - ctypes_c_ulong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ulong"); - ctypes_c_longlong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_longlong"); - ctypes_c_ulonglong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ulonglong"); - ctypes_c_size_t = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_size_t"); - ctypes_c_float = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_float"); - ctypes_c_double = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_double"); - ctypes_c_void_p = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_void_p"); // == c_voidp -} - - -// (target type, source type) -std::map, std::function> m_feeders; - -void populate_feeders(PyTypeObject* target_t, PyTypeObject* source_t) -{ - if (target_t == ctypes_c_int) - { - if (source_t == &PyLong_Type) - { - m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int - { - *((int*)ptr) = (int)PyLong_AsLong(value); - return sizeof(int); - }; - return; - } - } else if (target_t == ctypes_c_bool) { - if (source_t == &PyBool_Type) - { - m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int - { - *((bool*)ptr) = (value == Py_True); - return sizeof(bool); - }; - return; - } - } else if (target_t == ctypes_c_byte) { - if (source_t == &PyLong_Type) - { - m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int - { - *((int8_t*)ptr) = (int8_t)PyLong_AsLong(value); - return sizeof(int8_t); - }; - return; - } - } else if (target_t == ctypes_c_double) { - if (source_t == &PyFloat_Type) - { - m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int - { - *((double*)ptr) = (double)PyFloat_AsDouble(value); - return sizeof(double); - }; - return; - } - } else if (target_t == ctypes_c_float) { - if (source_t == &PyFloat_Type) - { - m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int - { - *((float*)ptr) = (float)PyFloat_AsDouble(value); - return sizeof(float); - }; - return; - } - } else if (target_t == ctypes_c_longlong) { - if (source_t == &PyLong_Type) - { - m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int - { - *((long long*)ptr) = (long long)PyLong_AsLongLong(value); - return sizeof(long long); - }; - return; - } - } -} - -int feed(void* ptr, PyObject* value, PyObject* type) -{ - PyTypeObject* pto = (PyTypeObject*)type; - if (ctypes_c_int == nullptr) - fetch_ctypes(); - auto found = m_feeders.find({pto,value->ob_type}); - if (found == m_feeders.end()) - { - populate_feeders(pto, value->ob_type); - found = m_feeders.find({pto,value->ob_type}); - } - if (found != m_feeders.end()) - { - return found->second(ptr, value); - } - return 0; -} diff --git a/cuda/cuda/bindings/benchmarks/__init__.py b/cuda/cuda/bindings/benchmarks/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/cuda/cuda/bindings/examples/__init__.py b/cuda/cuda/bindings/examples/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/cuda/cuda/bindings/examples/setup.cfg b/cuda/cuda/bindings/examples/setup.cfg deleted file mode 100644 index ac22d83c..00000000 --- a/cuda/cuda/bindings/examples/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[tool:pytest] -python_files=*_test.py -python_functions=main diff --git a/cuda/cuda/bindings/tests/__init__.py b/cuda/cuda/bindings/tests/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/cuda/LICENSE b/cuda_bindings/LICENSE similarity index 100% rename from cuda/LICENSE rename to cuda_bindings/LICENSE diff --git a/cuda/MANIFEST.in b/cuda_bindings/MANIFEST.in similarity index 100% rename from cuda/MANIFEST.in rename to cuda_bindings/MANIFEST.in diff --git a/cuda/README.md b/cuda_bindings/README.md similarity index 96% rename from cuda/README.md rename to cuda_bindings/README.md index 1cbafb56..325f1309 100644 --- a/cuda/README.md +++ b/cuda_bindings/README.md @@ -42,7 +42,7 @@ Latest dependencies can be found in [requirements.txt](https://github.com/NVIDIA You can run the included tests with: ``` -python -m pytest +python -m pytest tests/ ``` ### Benchmark @@ -50,7 +50,7 @@ python -m pytest You can run benchmark only tests with: ``` -python -m pytest --benchmark-only +python -m pytest --benchmark-only benchmark/ ``` ### Samples @@ -58,7 +58,7 @@ python -m pytest --benchmark-only You can run the included tests with: ``` -python -m pytest examples +python -m pytest examples/ ``` ## Examples diff --git a/cuda/cuda/bindings/benchmarks/kernels.py b/cuda_bindings/benchmarks/kernels.py similarity index 100% rename from cuda/cuda/bindings/benchmarks/kernels.py rename to cuda_bindings/benchmarks/kernels.py diff --git a/cuda/cuda/bindings/benchmarks/perf_test_utils.py b/cuda_bindings/benchmarks/perf_test_utils.py similarity index 100% rename from cuda/cuda/bindings/benchmarks/perf_test_utils.py rename to cuda_bindings/benchmarks/perf_test_utils.py diff --git a/cuda/pytest.ini b/cuda_bindings/benchmarks/pytest.ini similarity index 84% rename from cuda/pytest.ini rename to cuda_bindings/benchmarks/pytest.ini index a8dcb34c..a74acd3e 100644 --- a/cuda/pytest.ini +++ b/cuda_bindings/benchmarks/pytest.ini @@ -1,4 +1,3 @@ -# pytest.ini [pytest] required_plugins = pytest-benchmark addopts = --benchmark-skip diff --git a/cuda/cuda/bindings/benchmarks/test_cupy.py b/cuda_bindings/benchmarks/test_cupy.py similarity index 100% rename from cuda/cuda/bindings/benchmarks/test_cupy.py rename to cuda_bindings/benchmarks/test_cupy.py diff --git a/cuda/cuda/bindings/benchmarks/test_launch_latency.py b/cuda_bindings/benchmarks/test_launch_latency.py similarity index 100% rename from cuda/cuda/bindings/benchmarks/test_launch_latency.py rename to cuda_bindings/benchmarks/test_launch_latency.py diff --git a/cuda/cuda/bindings/benchmarks/test_numba.py b/cuda_bindings/benchmarks/test_numba.py similarity index 100% rename from cuda/cuda/bindings/benchmarks/test_numba.py rename to cuda_bindings/benchmarks/test_numba.py diff --git a/cuda/cuda/bindings/benchmarks/test_pointer_attributes.py b/cuda_bindings/benchmarks/test_pointer_attributes.py similarity index 100% rename from cuda/cuda/bindings/benchmarks/test_pointer_attributes.py rename to cuda_bindings/benchmarks/test_pointer_attributes.py diff --git a/cuda/cuda/__init__.pxd b/cuda_bindings/cuda/__init__.pxd similarity index 100% rename from cuda/cuda/__init__.pxd rename to cuda_bindings/cuda/__init__.pxd diff --git a/cuda/cuda/__init__.py b/cuda_bindings/cuda/__init__.py similarity index 100% rename from cuda/cuda/__init__.py rename to cuda_bindings/cuda/__init__.py diff --git a/cuda/cuda/bindings/__init__.pxd b/cuda_bindings/cuda/bindings/__init__.pxd similarity index 100% rename from cuda/cuda/bindings/__init__.pxd rename to cuda_bindings/cuda/bindings/__init__.pxd diff --git a/cuda/cuda/bindings/__init__.py b/cuda_bindings/cuda/bindings/__init__.py similarity index 100% rename from cuda/cuda/bindings/__init__.py rename to cuda_bindings/cuda/bindings/__init__.py diff --git a/cuda/cuda/bindings/_bindings/__init__.py b/cuda_bindings/cuda/bindings/_bindings/__init__.py similarity index 100% rename from cuda/cuda/bindings/_bindings/__init__.py rename to cuda_bindings/cuda/bindings/_bindings/__init__.py diff --git a/cuda/cuda/bindings/_bindings/cydriver.pxd.in b/cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in similarity index 100% rename from cuda/cuda/bindings/_bindings/cydriver.pxd.in rename to cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in diff --git a/cuda/cuda/bindings/_bindings/cydriver.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in similarity index 100% rename from cuda/cuda/bindings/_bindings/cydriver.pyx.in rename to cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in diff --git a/cuda/cuda/bindings/_bindings/cynvrtc.pxd.in b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd.in similarity index 100% rename from cuda/cuda/bindings/_bindings/cynvrtc.pxd.in rename to cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd.in diff --git a/cuda/cuda/bindings/_bindings/cynvrtc.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in similarity index 100% rename from cuda/cuda/bindings/_bindings/cynvrtc.pyx.in rename to cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in diff --git a/cuda/cuda/bindings/_bindings/loader.h b/cuda_bindings/cuda/bindings/_bindings/loader.h similarity index 100% rename from cuda/cuda/bindings/_bindings/loader.h rename to cuda_bindings/cuda/bindings/_bindings/loader.h diff --git a/cuda/cuda/bindings/_bindings/loader.pxd b/cuda_bindings/cuda/bindings/_bindings/loader.pxd similarity index 100% rename from cuda/cuda/bindings/_bindings/loader.pxd rename to cuda_bindings/cuda/bindings/_bindings/loader.pxd diff --git a/cuda/cuda/bindings/_lib/__init__.py b/cuda_bindings/cuda/bindings/_lib/__init__.py similarity index 100% rename from cuda/cuda/bindings/_lib/__init__.py rename to cuda_bindings/cuda/bindings/_lib/__init__.py diff --git a/cuda/cuda/bindings/_lib/cyruntime/__init__.py b/cuda_bindings/cuda/bindings/_lib/cyruntime/__init__.py similarity index 100% rename from cuda/cuda/bindings/_lib/cyruntime/__init__.py rename to cuda_bindings/cuda/bindings/_lib/cyruntime/__init__.py diff --git a/cuda/cuda/bindings/_lib/cyruntime/cyruntime.pxd.in b/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd.in similarity index 100% rename from cuda/cuda/bindings/_lib/cyruntime/cyruntime.pxd.in rename to cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd.in diff --git a/cuda/cuda/bindings/_lib/cyruntime/cyruntime.pyx.in b/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pyx.in similarity index 100% rename from cuda/cuda/bindings/_lib/cyruntime/cyruntime.pyx.in rename to cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pyx.in diff --git a/cuda/cuda/bindings/_lib/cyruntime/utils.pxd.in b/cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pxd.in similarity index 100% rename from cuda/cuda/bindings/_lib/cyruntime/utils.pxd.in rename to cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pxd.in diff --git a/cuda/cuda/bindings/_lib/cyruntime/utils.pyx.in b/cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pyx.in similarity index 100% rename from cuda/cuda/bindings/_lib/cyruntime/utils.pyx.in rename to cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pyx.in diff --git a/cuda/cuda/bindings/_lib/dlfcn.pxd b/cuda_bindings/cuda/bindings/_lib/dlfcn.pxd similarity index 100% rename from cuda/cuda/bindings/_lib/dlfcn.pxd rename to cuda_bindings/cuda/bindings/_lib/dlfcn.pxd diff --git a/cuda/cuda/bindings/_lib/param_packer.h b/cuda_bindings/cuda/bindings/_lib/param_packer.h similarity index 100% rename from cuda/cuda/bindings/_lib/param_packer.h rename to cuda_bindings/cuda/bindings/_lib/param_packer.h diff --git a/cuda/cuda/bindings/_lib/param_packer.pxd b/cuda_bindings/cuda/bindings/_lib/param_packer.pxd similarity index 100% rename from cuda/cuda/bindings/_lib/param_packer.pxd rename to cuda_bindings/cuda/bindings/_lib/param_packer.pxd diff --git a/cuda/cuda/bindings/_lib/utils.pxd.in b/cuda_bindings/cuda/bindings/_lib/utils.pxd.in similarity index 100% rename from cuda/cuda/bindings/_lib/utils.pxd.in rename to cuda_bindings/cuda/bindings/_lib/utils.pxd.in diff --git a/cuda/cuda/bindings/_lib/utils.pyx.in b/cuda_bindings/cuda/bindings/_lib/utils.pyx.in similarity index 100% rename from cuda/cuda/bindings/_lib/utils.pyx.in rename to cuda_bindings/cuda/bindings/_lib/utils.pyx.in diff --git a/cuda/cuda/bindings/_version.py b/cuda_bindings/cuda/bindings/_version.py similarity index 100% rename from cuda/cuda/bindings/_version.py rename to cuda_bindings/cuda/bindings/_version.py diff --git a/cuda/cuda/bindings/cydriver.pxd.in b/cuda_bindings/cuda/bindings/cydriver.pxd.in similarity index 100% rename from cuda/cuda/bindings/cydriver.pxd.in rename to cuda_bindings/cuda/bindings/cydriver.pxd.in diff --git a/cuda/cuda/bindings/cydriver.pyx.in b/cuda_bindings/cuda/bindings/cydriver.pyx.in similarity index 100% rename from cuda/cuda/bindings/cydriver.pyx.in rename to cuda_bindings/cuda/bindings/cydriver.pyx.in diff --git a/cuda/cuda/bindings/cynvrtc.pxd.in b/cuda_bindings/cuda/bindings/cynvrtc.pxd.in similarity index 100% rename from cuda/cuda/bindings/cynvrtc.pxd.in rename to cuda_bindings/cuda/bindings/cynvrtc.pxd.in diff --git a/cuda/cuda/bindings/cynvrtc.pyx.in b/cuda_bindings/cuda/bindings/cynvrtc.pyx.in similarity index 100% rename from cuda/cuda/bindings/cynvrtc.pyx.in rename to cuda_bindings/cuda/bindings/cynvrtc.pyx.in diff --git a/cuda/cuda/bindings/cyruntime.pxd.in b/cuda_bindings/cuda/bindings/cyruntime.pxd.in similarity index 100% rename from cuda/cuda/bindings/cyruntime.pxd.in rename to cuda_bindings/cuda/bindings/cyruntime.pxd.in diff --git a/cuda/cuda/bindings/cyruntime.pyx.in b/cuda_bindings/cuda/bindings/cyruntime.pyx.in similarity index 100% rename from cuda/cuda/bindings/cyruntime.pyx.in rename to cuda_bindings/cuda/bindings/cyruntime.pyx.in diff --git a/cuda/cuda/bindings/driver.pxd.in b/cuda_bindings/cuda/bindings/driver.pxd.in similarity index 100% rename from cuda/cuda/bindings/driver.pxd.in rename to cuda_bindings/cuda/bindings/driver.pxd.in diff --git a/cuda/cuda/bindings/driver.pyx.in b/cuda_bindings/cuda/bindings/driver.pyx.in similarity index 100% rename from cuda/cuda/bindings/driver.pyx.in rename to cuda_bindings/cuda/bindings/driver.pyx.in diff --git a/cuda/cuda/bindings/nvrtc.pxd.in b/cuda_bindings/cuda/bindings/nvrtc.pxd.in similarity index 100% rename from cuda/cuda/bindings/nvrtc.pxd.in rename to cuda_bindings/cuda/bindings/nvrtc.pxd.in diff --git a/cuda/cuda/bindings/nvrtc.pyx.in b/cuda_bindings/cuda/bindings/nvrtc.pyx.in similarity index 100% rename from cuda/cuda/bindings/nvrtc.pyx.in rename to cuda_bindings/cuda/bindings/nvrtc.pyx.in diff --git a/cuda/cuda/bindings/runtime.pxd.in b/cuda_bindings/cuda/bindings/runtime.pxd.in similarity index 100% rename from cuda/cuda/bindings/runtime.pxd.in rename to cuda_bindings/cuda/bindings/runtime.pxd.in diff --git a/cuda/cuda/bindings/runtime.pyx.in b/cuda_bindings/cuda/bindings/runtime.pyx.in similarity index 100% rename from cuda/cuda/bindings/runtime.pyx.in rename to cuda_bindings/cuda/bindings/runtime.pyx.in diff --git a/cuda/cuda/ccuda.pxd b/cuda_bindings/cuda/ccuda.pxd similarity index 100% rename from cuda/cuda/ccuda.pxd rename to cuda_bindings/cuda/ccuda.pxd diff --git a/cuda/cuda/ccuda.pyx b/cuda_bindings/cuda/ccuda.pyx similarity index 100% rename from cuda/cuda/ccuda.pyx rename to cuda_bindings/cuda/ccuda.pyx diff --git a/cuda/cuda/ccudart.pxd b/cuda_bindings/cuda/ccudart.pxd similarity index 100% rename from cuda/cuda/ccudart.pxd rename to cuda_bindings/cuda/ccudart.pxd diff --git a/cuda/cuda/ccudart.pyx b/cuda_bindings/cuda/ccudart.pyx similarity index 100% rename from cuda/cuda/ccudart.pyx rename to cuda_bindings/cuda/ccudart.pyx diff --git a/cuda/cuda/cnvrtc.pxd b/cuda_bindings/cuda/cnvrtc.pxd similarity index 100% rename from cuda/cuda/cnvrtc.pxd rename to cuda_bindings/cuda/cnvrtc.pxd diff --git a/cuda/cuda/cnvrtc.pyx b/cuda_bindings/cuda/cnvrtc.pyx similarity index 100% rename from cuda/cuda/cnvrtc.pyx rename to cuda_bindings/cuda/cnvrtc.pyx diff --git a/cuda/cuda/cuda.pyx b/cuda_bindings/cuda/cuda.pyx similarity index 100% rename from cuda/cuda/cuda.pyx rename to cuda_bindings/cuda/cuda.pyx diff --git a/cuda/cuda/cudart.pyx b/cuda_bindings/cuda/cudart.pyx similarity index 100% rename from cuda/cuda/cudart.pyx rename to cuda_bindings/cuda/cudart.pyx diff --git a/cuda/cuda/nvrtc.pyx b/cuda_bindings/cuda/nvrtc.pyx similarity index 100% rename from cuda/cuda/nvrtc.pyx rename to cuda_bindings/cuda/nvrtc.pyx diff --git a/cuda/cuda/bindings/examples/0_Introduction/clock_nvrtc_test.py b/cuda_bindings/examples/0_Introduction/clock_nvrtc_test.py similarity index 93% rename from cuda/cuda/bindings/examples/0_Introduction/clock_nvrtc_test.py rename to cuda_bindings/examples/0_Introduction/clock_nvrtc_test.py index cbfe4d21..49a7a1e0 100644 --- a/cuda/cuda/bindings/examples/0_Introduction/clock_nvrtc_test.py +++ b/cuda_bindings/examples/0_Introduction/clock_nvrtc_test.py @@ -1,4 +1,4 @@ -# Copyright 2021-2022 NVIDIA Corporation. All rights reserved. +# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. # # Please refer to the NVIDIA end user license agreement (EULA) associated # with this source code for terms and conditions that govern your use of @@ -7,8 +7,8 @@ # is strictly prohibited. import numpy as np from cuda import cuda -from cuda.bindings.examples.common import common -from cuda.bindings.examples.common.helper_cuda import checkCudaErrors, findCudaDevice +from common import common +from common.helper_cuda import checkCudaErrors, findCudaDevice clock_nvrtc = '''\ extern "C" __global__ void timedReduction(const float *hinput, float *output, clock_t *timer) diff --git a/cuda/cuda/bindings/examples/0_Introduction/simpleCubemapTexture_test.py b/cuda_bindings/examples/0_Introduction/simpleCubemapTexture_test.py similarity index 97% rename from cuda/cuda/bindings/examples/0_Introduction/simpleCubemapTexture_test.py rename to cuda_bindings/examples/0_Introduction/simpleCubemapTexture_test.py index 19d658fb..adb5a560 100644 --- a/cuda/cuda/bindings/examples/0_Introduction/simpleCubemapTexture_test.py +++ b/cuda_bindings/examples/0_Introduction/simpleCubemapTexture_test.py @@ -1,4 +1,4 @@ -# Copyright 2021-2022 NVIDIA Corporation. All rights reserved. +# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. # # Please refer to the NVIDIA end user license agreement (EULA) associated # with this source code for terms and conditions that govern your use of @@ -11,8 +11,8 @@ import sys import time from cuda import cuda, cudart -from cuda.bindings.examples.common import common -from cuda.bindings.examples.common.helper_cuda import checkCudaErrors, findCudaDevice +from common import common +from common.helper_cuda import checkCudaErrors, findCudaDevice simpleCubemapTexture = '''\ extern "C" diff --git a/cuda/cuda/bindings/examples/0_Introduction/simpleP2P_test.py b/cuda_bindings/examples/0_Introduction/simpleP2P_test.py similarity index 97% rename from cuda/cuda/bindings/examples/0_Introduction/simpleP2P_test.py rename to cuda_bindings/examples/0_Introduction/simpleP2P_test.py index 762d4f80..d4d17de1 100644 --- a/cuda/cuda/bindings/examples/0_Introduction/simpleP2P_test.py +++ b/cuda_bindings/examples/0_Introduction/simpleP2P_test.py @@ -1,4 +1,4 @@ -# Copyright 2021-2022 NVIDIA Corporation. All rights reserved. +# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. # # Please refer to the NVIDIA end user license agreement (EULA) associated # with this source code for terms and conditions that govern your use of @@ -9,8 +9,8 @@ import numpy as np import sys from cuda import cuda, cudart -from cuda.bindings.examples.common import common -from cuda.bindings.examples.common.helper_cuda import checkCudaErrors +from common import common +from common.helper_cuda import checkCudaErrors simplep2p = '''\ extern "C" diff --git a/cuda/cuda/bindings/examples/0_Introduction/simpleZeroCopy_test.py b/cuda_bindings/examples/0_Introduction/simpleZeroCopy_test.py similarity index 95% rename from cuda/cuda/bindings/examples/0_Introduction/simpleZeroCopy_test.py rename to cuda_bindings/examples/0_Introduction/simpleZeroCopy_test.py index 255e0a60..834eb32a 100644 --- a/cuda/cuda/bindings/examples/0_Introduction/simpleZeroCopy_test.py +++ b/cuda_bindings/examples/0_Introduction/simpleZeroCopy_test.py @@ -1,4 +1,4 @@ -# Copyright 2021-2022 NVIDIA Corporation. All rights reserved. +# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. # # Please refer to the NVIDIA end user license agreement (EULA) associated # with this source code for terms and conditions that govern your use of @@ -11,9 +11,9 @@ import random as rnd import sys from cuda import cuda, cudart -from cuda.bindings.examples.common import common -from cuda.bindings.examples.common.helper_cuda import checkCudaErrors -from cuda.bindings.examples.common.helper_string import checkCmdLineFlag +from common import common +from common.helper_cuda import checkCudaErrors +from common.helper_string import checkCmdLineFlag simpleZeroCopy = '''\ extern "C" diff --git a/cuda/cuda/bindings/examples/0_Introduction/systemWideAtomics_test.py b/cuda_bindings/examples/0_Introduction/systemWideAtomics_test.py similarity index 97% rename from cuda/cuda/bindings/examples/0_Introduction/systemWideAtomics_test.py rename to cuda_bindings/examples/0_Introduction/systemWideAtomics_test.py index abca7bbe..f34f3195 100644 --- a/cuda/cuda/bindings/examples/0_Introduction/systemWideAtomics_test.py +++ b/cuda_bindings/examples/0_Introduction/systemWideAtomics_test.py @@ -1,4 +1,4 @@ -# Copyright 2021-2022 NVIDIA Corporation. All rights reserved. +# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. # # Please refer to the NVIDIA end user license agreement (EULA) associated # with this source code for terms and conditions that govern your use of @@ -10,8 +10,8 @@ import sys import os from cuda import cuda, cudart -from cuda.bindings.examples.common import common -from cuda.bindings.examples.common.helper_cuda import checkCudaErrors, findCudaDevice +from common import common +from common.helper_cuda import checkCudaErrors, findCudaDevice systemWideAtomics = '''\ #define LOOP_NUM 50 diff --git a/cuda/cuda/bindings/examples/0_Introduction/vectorAddDrv_test.py b/cuda_bindings/examples/0_Introduction/vectorAddDrv_test.py similarity index 94% rename from cuda/cuda/bindings/examples/0_Introduction/vectorAddDrv_test.py rename to cuda_bindings/examples/0_Introduction/vectorAddDrv_test.py index 2f970182..32934040 100644 --- a/cuda/cuda/bindings/examples/0_Introduction/vectorAddDrv_test.py +++ b/cuda_bindings/examples/0_Introduction/vectorAddDrv_test.py @@ -1,4 +1,4 @@ -# Copyright 2021-2022 NVIDIA Corporation. All rights reserved. +# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. # # Please refer to the NVIDIA end user license agreement (EULA) associated # with this source code for terms and conditions that govern your use of @@ -9,8 +9,8 @@ import math import numpy as np from cuda import cuda -from cuda.bindings.examples.common import common -from cuda.bindings.examples.common.helper_cuda import checkCudaErrors, findCudaDeviceDRV +from common import common +from common.helper_cuda import checkCudaErrors, findCudaDeviceDRV vectorAddDrv = '''\ /* Vector addition: C = A + B. diff --git a/cuda/cuda/bindings/examples/0_Introduction/vectorAddMMAP_test.py b/cuda_bindings/examples/0_Introduction/vectorAddMMAP_test.py similarity index 98% rename from cuda/cuda/bindings/examples/0_Introduction/vectorAddMMAP_test.py rename to cuda_bindings/examples/0_Introduction/vectorAddMMAP_test.py index 82b7b429..8af4a833 100644 --- a/cuda/cuda/bindings/examples/0_Introduction/vectorAddMMAP_test.py +++ b/cuda_bindings/examples/0_Introduction/vectorAddMMAP_test.py @@ -1,4 +1,4 @@ -# Copyright 2021-2022 NVIDIA Corporation. All rights reserved. +# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. # # Please refer to the NVIDIA end user license agreement (EULA) associated # with this source code for terms and conditions that govern your use of @@ -10,8 +10,8 @@ import numpy as np import sys from cuda import cuda -from cuda.bindings.examples.common import common -from cuda.bindings.examples.common.helper_cuda import checkCudaErrors, findCudaDeviceDRV +from common import common +from common.helper_cuda import checkCudaErrors, findCudaDeviceDRV vectorAddMMAP = '''\ /* Vector addition: C = A + B. diff --git a/cuda/cuda/bindings/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py b/cuda_bindings/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py similarity index 96% rename from cuda/cuda/bindings/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py rename to cuda_bindings/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py index 37cf1573..c2723e51 100644 --- a/cuda/cuda/bindings/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py +++ b/cuda_bindings/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py @@ -1,4 +1,4 @@ -# Copyright 2021-2022 NVIDIA Corporation. All rights reserved. +# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. # # Please refer to the NVIDIA end user license agreement (EULA) associated # with this source code for terms and conditions that govern your use of @@ -11,9 +11,9 @@ import random as rnd import sys from cuda import cuda, cudart -from cuda.bindings.examples.common import common -from cuda.bindings.examples.common.helper_cuda import checkCudaErrors, findCudaDevice -from cuda.bindings.examples.common.helper_string import checkCmdLineFlag +from common import common +from common.helper_cuda import checkCudaErrors, findCudaDevice +from common.helper_string import checkCmdLineFlag streamOrderedAllocation = '''\ /* Add two vectors on the GPU */ diff --git a/cuda/cuda/bindings/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py b/cuda_bindings/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py similarity index 99% rename from cuda/cuda/bindings/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py rename to cuda_bindings/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py index 823fbe5f..bb6b5cb0 100644 --- a/cuda/cuda/bindings/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py +++ b/cuda_bindings/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py @@ -1,4 +1,4 @@ -# Copyright 2021-2022 NVIDIA Corporation. All rights reserved. +# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. # # Please refer to the NVIDIA end user license agreement (EULA) associated # with this source code for terms and conditions that govern your use of @@ -12,9 +12,9 @@ import pytest from cuda import cuda, cudart from enum import Enum -from cuda.bindings.examples.common import common -from cuda.bindings.examples.common.helper_cuda import checkCudaErrors, findCudaDevice -from cuda.bindings.examples.common.helper_string import checkCmdLineFlag, getCmdLineArgumentInt +from common import common +from common.helper_cuda import checkCudaErrors, findCudaDevice +from common.helper_string import checkCmdLineFlag, getCmdLineArgumentInt blockSize = 16 class kernels(Enum): diff --git a/cuda/cuda/bindings/examples/3_CUDA_Features/simpleCudaGraphs_test.py b/cuda_bindings/examples/3_CUDA_Features/simpleCudaGraphs_test.py similarity index 98% rename from cuda/cuda/bindings/examples/3_CUDA_Features/simpleCudaGraphs_test.py rename to cuda_bindings/examples/3_CUDA_Features/simpleCudaGraphs_test.py index f843ba9d..9c269b68 100644 --- a/cuda/cuda/bindings/examples/3_CUDA_Features/simpleCudaGraphs_test.py +++ b/cuda_bindings/examples/3_CUDA_Features/simpleCudaGraphs_test.py @@ -1,4 +1,4 @@ -# Copyright 2021-2022 NVIDIA Corporation. All rights reserved. +# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. # # Please refer to the NVIDIA end user license agreement (EULA) associated # with this source code for terms and conditions that govern your use of @@ -9,8 +9,8 @@ import numpy as np import random as rnd from cuda import cuda, cudart -from cuda.bindings.examples.common import common -from cuda.bindings.examples.common.helper_cuda import checkCudaErrors, findCudaDevice +from common import common +from common.helper_cuda import checkCudaErrors, findCudaDevice THREADS_PER_BLOCK = 512 GRAPH_LAUNCH_ITERATIONS = 3 diff --git a/cuda/cuda/bindings/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py b/cuda_bindings/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py similarity index 98% rename from cuda/cuda/bindings/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py rename to cuda_bindings/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py index 80ff0254..6f64066f 100644 --- a/cuda/cuda/bindings/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py +++ b/cuda_bindings/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py @@ -1,4 +1,4 @@ -# Copyright 2021-2022 NVIDIA Corporation. All rights reserved. +# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. # # Please refer to the NVIDIA end user license agreement (EULA) associated # with this source code for terms and conditions that govern your use of @@ -10,8 +10,8 @@ import numpy as np import sys from cuda import cuda, cudart -from cuda.bindings.examples.common import common -from cuda.bindings.examples.common.helper_cuda import checkCudaErrors, findCudaDevice +from common import common +from common.helper_cuda import checkCudaErrors, findCudaDevice from random import random conjugateGradientMultiBlockCG = '''\ diff --git a/cuda/cuda/bindings/examples/common/common.py b/cuda_bindings/examples/common/common.py similarity index 94% rename from cuda/cuda/bindings/examples/common/common.py rename to cuda_bindings/examples/common/common.py index 663ead99..ce3abb6a 100644 --- a/cuda/cuda/bindings/examples/common/common.py +++ b/cuda_bindings/examples/common/common.py @@ -1,4 +1,4 @@ -# Copyright 2021-2022 NVIDIA Corporation. All rights reserved. +# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. # # Please refer to the NVIDIA end user license agreement (EULA) associated # with this source code for terms and conditions that govern your use of @@ -9,7 +9,7 @@ import numpy as np import os from cuda import cuda, cudart, nvrtc -from cuda.bindings.examples.common.helper_cuda import checkCudaErrors +from common.helper_cuda import checkCudaErrors class KernelHelper: def __init__(self, code, devID): diff --git a/cuda/cuda/bindings/examples/common/helper_cuda.py b/cuda_bindings/examples/common/helper_cuda.py similarity index 90% rename from cuda/cuda/bindings/examples/common/helper_cuda.py rename to cuda_bindings/examples/common/helper_cuda.py index 75043ff1..cbd0d2da 100644 --- a/cuda/cuda/bindings/examples/common/helper_cuda.py +++ b/cuda_bindings/examples/common/helper_cuda.py @@ -1,4 +1,4 @@ -# Copyright 2021-2022 NVIDIA Corporation. All rights reserved. +# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. # # Please refer to the NVIDIA end user license agreement (EULA) associated # with this source code for terms and conditions that govern your use of @@ -6,7 +6,7 @@ # this software and related documentation outside the terms of the EULA # is strictly prohibited. from cuda import cuda, cudart, nvrtc -from cuda.bindings.examples.common.helper_string import getCmdLineArgumentInt, checkCmdLineFlag +from common.helper_string import getCmdLineArgumentInt, checkCmdLineFlag def _cudaGetErrorEnum(error): if isinstance(error, cuda.CUresult): diff --git a/cuda/cuda/bindings/examples/common/helper_string.py b/cuda_bindings/examples/common/helper_string.py similarity index 91% rename from cuda/cuda/bindings/examples/common/helper_string.py rename to cuda_bindings/examples/common/helper_string.py index 05174999..1e0d65f1 100644 --- a/cuda/cuda/bindings/examples/common/helper_string.py +++ b/cuda_bindings/examples/common/helper_string.py @@ -1,4 +1,4 @@ -# Copyright 2021-2022 NVIDIA Corporation. All rights reserved. +# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. # # Please refer to the NVIDIA end user license agreement (EULA) associated # with this source code for terms and conditions that govern your use of diff --git a/cuda/cuda/bindings/examples/extra/isoFDModelling_test.py b/cuda_bindings/examples/extra/isoFDModelling_test.py similarity index 99% rename from cuda/cuda/bindings/examples/extra/isoFDModelling_test.py rename to cuda_bindings/examples/extra/isoFDModelling_test.py index 50277f94..26cbe191 100644 --- a/cuda/cuda/bindings/examples/extra/isoFDModelling_test.py +++ b/cuda_bindings/examples/extra/isoFDModelling_test.py @@ -8,8 +8,8 @@ import numpy as np import time from cuda import cuda, cudart -from cuda.bindings.examples.common import common -from cuda.bindings.examples.common.helper_cuda import checkCudaErrors +from common import common +from common.helper_cuda import checkCudaErrors isoPropagator = '''\ extern "C" diff --git a/cuda/cuda/bindings/examples/extra/jit_program_test.py b/cuda_bindings/examples/extra/jit_program_test.py similarity index 100% rename from cuda/cuda/bindings/examples/extra/jit_program_test.py rename to cuda_bindings/examples/extra/jit_program_test.py diff --git a/cuda/cuda/bindings/examples/extra/numba_emm_plugin.py b/cuda_bindings/examples/extra/numba_emm_plugin.py similarity index 100% rename from cuda/cuda/bindings/examples/extra/numba_emm_plugin.py rename to cuda_bindings/examples/extra/numba_emm_plugin.py diff --git a/cuda_bindings/examples/pytest.ini b/cuda_bindings/examples/pytest.ini new file mode 100644 index 00000000..e105585d --- /dev/null +++ b/cuda_bindings/examples/pytest.ini @@ -0,0 +1,4 @@ +[pytest] +python_files = *_test.py +python_functions = main +pythonpath = . diff --git a/cuda/pyproject.toml b/cuda_bindings/pyproject.toml similarity index 100% rename from cuda/pyproject.toml rename to cuda_bindings/pyproject.toml diff --git a/cuda/requirements.txt b/cuda_bindings/requirements.txt similarity index 100% rename from cuda/requirements.txt rename to cuda_bindings/requirements.txt diff --git a/cuda/setup.py b/cuda_bindings/setup.py similarity index 96% rename from cuda/setup.py rename to cuda_bindings/setup.py index ec523626..fb9d7b95 100644 --- a/cuda/setup.py +++ b/cuda_bindings/setup.py @@ -95,6 +95,10 @@ cache='./cache_{}'.format(library.split('.')[0]) if PARSER_CACHING else None, replace=replace) + if library == 'driver': + CUDA_VERSION = parser.defs['macros']['CUDA_VERSION'] if 'CUDA_VERSION' in parser.defs['macros'] else 'Unknown' + print(f'Found CUDA_VERSION: {CUDA_VERSION}') + # Combine types with others since they sometimes get tangled found_types += {key for key in parser.defs['types']} found_types += {key for key in parser.defs['structs']} @@ -225,7 +229,7 @@ def do_cythonize(extensions): # public (deprecated, to be removed) ["cuda/*.pyx"], # tests - ["cuda/bindings/tests/*.pyx"], + ["tests/*.pyx"], ] for sources in sources_list: @@ -256,9 +260,9 @@ def finalize_options(self): setup( version=versioneer.get_version(), ext_modules=do_cythonize(extensions), - packages=find_packages(include=["cuda.cuda", "cuda.cuda.*", "cuda.cuda.bindings", "cuda.cuda.bindings._bindings", "cuda.cuda.bindings._lib", "cuda.cuda.bindings._lib.cyruntime", "cuda.cuda.bindings.tests"]), + packages=find_packages(include=["cuda.cuda", "cuda.cuda.*", "cuda.cuda.bindings", "cuda.cuda.bindings._bindings", "cuda.cuda.bindings._lib", "cuda.cuda.bindings._lib.cyruntime", "tests"]), package_data=dict.fromkeys( - find_packages(include=["cuda.cuda", "cuda.cuda.*", "cuda.cuda.bindings", "cuda.cuda.bindings._bindings", "cuda.cuda.bindings._lib", "cuda.cuda.bindings._lib.cyruntime", "cuda.cuda.bindings.tests"]), + find_packages(include=["cuda.cuda", "cuda.cuda.*", "cuda.cuda.bindings", "cuda.cuda.bindings._bindings", "cuda.cuda.bindings._lib", "cuda.cuda.bindings._lib.cyruntime", "tests"]), ["*.pxd", "*.pyx", "*.py", "*.h", "*.cpp"], ), cmdclass=cmdclass, diff --git a/cuda/cuda/bindings/tests/test_ccuda.pyx b/cuda_bindings/tests/test_ccuda.pyx similarity index 100% rename from cuda/cuda/bindings/tests/test_ccuda.pyx rename to cuda_bindings/tests/test_ccuda.pyx diff --git a/cuda/cuda/bindings/tests/test_ccudart.pyx b/cuda_bindings/tests/test_ccudart.pyx similarity index 100% rename from cuda/cuda/bindings/tests/test_ccudart.pyx rename to cuda_bindings/tests/test_ccudart.pyx diff --git a/cuda/cuda/bindings/tests/test_cuda.py b/cuda_bindings/tests/test_cuda.py similarity index 100% rename from cuda/cuda/bindings/tests/test_cuda.py rename to cuda_bindings/tests/test_cuda.py diff --git a/cuda/cuda/bindings/tests/test_cudart.py b/cuda_bindings/tests/test_cudart.py similarity index 100% rename from cuda/cuda/bindings/tests/test_cudart.py rename to cuda_bindings/tests/test_cudart.py diff --git a/cuda/cuda/bindings/tests/test_cython.py b/cuda_bindings/tests/test_cython.py similarity index 80% rename from cuda/cuda/bindings/tests/test_cython.py rename to cuda_bindings/tests/test_cython.py index e1f68e1c..439d7aa0 100644 --- a/cuda/cuda/bindings/tests/test_cython.py +++ b/cuda_bindings/tests/test_cython.py @@ -1,4 +1,4 @@ -# Copyright 2021-2022 NVIDIA Corporation. All rights reserved. +# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. # # Please refer to the NVIDIA end user license agreement (EULA) associated # with this source code for terms and conditions that govern your use of @@ -22,9 +22,9 @@ def wrapped(*args, **kwargs): return wrapped -cython_test_modules = ["cuda.bindings.tests.test_ccuda", - "cuda.bindings.tests.test_ccudart", - "cuda.bindings.tests.test_interoperability_cython"] +cython_test_modules = ["test_ccuda", + "test_ccudart", + "test_interoperability_cython"] for mod in cython_test_modules: diff --git a/cuda/cuda/bindings/tests/test_interoperability.py b/cuda_bindings/tests/test_interoperability.py similarity index 100% rename from cuda/cuda/bindings/tests/test_interoperability.py rename to cuda_bindings/tests/test_interoperability.py diff --git a/cuda/cuda/bindings/tests/test_interoperability_cython.pyx b/cuda_bindings/tests/test_interoperability_cython.pyx similarity index 100% rename from cuda/cuda/bindings/tests/test_interoperability_cython.pyx rename to cuda_bindings/tests/test_interoperability_cython.pyx diff --git a/cuda/cuda/bindings/tests/test_kernelParams.py b/cuda_bindings/tests/test_kernelParams.py similarity index 100% rename from cuda/cuda/bindings/tests/test_kernelParams.py rename to cuda_bindings/tests/test_kernelParams.py diff --git a/cuda/cuda/bindings/tests/test_nvrtc.py b/cuda_bindings/tests/test_nvrtc.py similarity index 100% rename from cuda/cuda/bindings/tests/test_nvrtc.py rename to cuda_bindings/tests/test_nvrtc.py