Bug 5196362, 5184356, 5212196, 5214258 and 5214259: Update sameples for CUDA13.0 API changes

This commit is contained in:
shawnz
2025-04-10 18:27:18 +08:00
parent 278f4adbd2
commit 02fdb070ad
27 changed files with 181 additions and 116 deletions

View File

@@ -118,13 +118,14 @@ bool runTest(int argc, char **argv);
// to be setup and the CUDA module (CUBIN) is built by NVCC
static CUresult InitCUDAContext(CUDAContext *pContext, CUdevice hcuDevice, int deviceID, char **argv)
{
CUcontext hcuContext = 0;
CUmodule hcuModule = 0;
CUfunction hcuFunction = 0;
CUdeviceptr dptr = 0;
CUcontext hcuContext = 0;
CUmodule hcuModule = 0;
CUfunction hcuFunction = 0;
CUdeviceptr dptr = 0;
CUctxCreateParams ctxCreateParams = {};
// cuCtxCreate: Function works on floating contexts and current context
CUresult status = cuCtxCreate(&hcuContext, 0, hcuDevice);
CUresult status = cuCtxCreate(&hcuContext, &ctxCreateParams, 0, hcuDevice);
if (CUDA_SUCCESS != status) {
fprintf(stderr, "cuCtxCreate for <deviceID=%d> failed %d\n", deviceID, status);