From bc025f519eefcec1a7bce944057b595beba56555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=85=AD=E7=94=9F?= <923847753@qq.com> Date: Mon, 5 Jun 2023 14:06:13 +0800 Subject: [PATCH] Update vectorAddDrv.cpp Fix an error passing the parameters --- Samples/0_Introduction/vectorAddDrv/vectorAddDrv.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Samples/0_Introduction/vectorAddDrv/vectorAddDrv.cpp b/Samples/0_Introduction/vectorAddDrv/vectorAddDrv.cpp index c025f5cd..3bec9aa7 100644 --- a/Samples/0_Introduction/vectorAddDrv/vectorAddDrv.cpp +++ b/Samples/0_Introduction/vectorAddDrv/vectorAddDrv.cpp @@ -158,11 +158,13 @@ int main(int argc, char **argv) { // Grid/Block configuration int threadsPerBlock = 256; int blocksPerGrid = (N + threadsPerBlock - 1) / threadsPerBlock; - + void *kernel_launch_config[5] = {CU_LAUNCH_PARAM_BUFFER_POINTER, + argBuffer, CU_LAUNCH_PARAM_BUFFER_SIZE, + &offset, CU_LAUNCH_PARAM_END}; // Launch the CUDA kernel checkCudaErrors(cuLaunchKernel(vecAdd_kernel, blocksPerGrid, 1, 1, threadsPerBlock, 1, 1, 0, NULL, NULL, - argBuffer)); + kernel_launch_config)); } #ifdef _DEBUG