diff --git a/test_conformance/SVM/test_pointer_passing.cpp b/test_conformance/SVM/test_pointer_passing.cpp index 6ef074d3..42baa76a 100644 --- a/test_conformance/SVM/test_pointer_passing.cpp +++ b/test_conformance/SVM/test_pointer_passing.cpp @@ -50,13 +50,13 @@ int test_svm_pointer_passing(cl_device_id deviceID, cl_context context2, cl_comm test_error(error,"clCreateKernel failed"); size_t bufSize = 256; - char *pbuf = (char*) clSVMAlloc(context, CL_MEM_READ_WRITE, sizeof(cl_uchar)*bufSize, 0); + cl_uchar *pbuf_svm_alloc = (cl_uchar*) clSVMAlloc(context, CL_MEM_READ_WRITE, sizeof(cl_uchar)*bufSize, 0); cl_int *pNumCorrect = NULL; pNumCorrect = (cl_int*) clSVMAlloc(context, CL_MEM_READ_WRITE, sizeof(cl_int), 0); { - clMemWrapper buf = clCreateBuffer(context, CL_MEM_USE_HOST_PTR, sizeof(cl_uchar)*bufSize, pbuf, &error); + clMemWrapper buf = clCreateBuffer(context, CL_MEM_USE_HOST_PTR, sizeof(cl_uchar)*bufSize, pbuf_svm_alloc, &error); test_error(error, "clCreateBuffer failed."); clMemWrapper num_correct = clCreateBuffer(context, CL_MEM_USE_HOST_PTR, sizeof(cl_int), pNumCorrect, &error); @@ -67,13 +67,13 @@ int test_svm_pointer_passing(cl_device_id deviceID, cl_context context2, cl_comm // put values into buf so that we can expect to see these values in the kernel when we pass a pointer to them. cl_command_queue cmdq = queues[0]; - cl_uchar* pBuf = (cl_uchar*) clEnqueueMapBuffer(cmdq, buf, CL_TRUE, CL_MAP_READ | CL_MAP_WRITE, 0, sizeof(cl_uchar)*bufSize, 0, NULL,NULL, &error); - test_error2(error, pBuf, "clEnqueueMapBuffer failed"); + cl_uchar* pbuf_map_buffer = (cl_uchar*) clEnqueueMapBuffer(cmdq, buf, CL_TRUE, CL_MAP_READ | CL_MAP_WRITE, 0, sizeof(cl_uchar)*bufSize, 0, NULL,NULL, &error); + test_error2(error, pbuf_map_buffer, "clEnqueueMapBuffer failed"); for(int i = 0; i<(int)bufSize; i++) { - pBuf[i]= (cl_uchar)i; + pbuf_map_buffer[i]= (cl_uchar)i; } - error = clEnqueueUnmapMemObject(cmdq, buf, pBuf, 0,NULL,NULL); + error = clEnqueueUnmapMemObject(cmdq, buf, pbuf_map_buffer, 0,NULL,NULL); test_error(error, "clEnqueueUnmapMemObject failed."); for (cl_uint ii = 0; ii