diff --git a/test_conformance/profiling/readArray.cpp b/test_conformance/profiling/readArray.cpp index 04bccbfb..b28afc1f 100644 --- a/test_conformance/profiling/readArray.cpp +++ b/test_conformance/profiling/readArray.cpp @@ -893,105 +893,3 @@ int test_read_array_struct( cl_device_id device, cl_context context, cl_command_ return test_stream_read( device, context, queue, num_elements, sizeof( TestStruct ), "struct", 1, stream_read_struct_kernel_code, struct_kernel_name, foo ); } - -/* -int read_struct_array(cl_device_group device, cl_device id, cl_context context, int num_elements) -{ - cl_mem streams[1]; - TestStruct *output_ptr; - cl_program program[1]; - cl_kernel kernel[1]; - void *values[1]; - size_t sizes[1] = { sizeof(cl_stream) }; - size_t threads[1]; -#ifdef USE_LOCAL_THREADS - size_t localThreads[1]; -#endif - int err; - size_t objSize = sizeof(TestStruct); - - threads[0] = (size_t)num_elements; - -#ifdef USE_LOCAL_THREADS - err = clGetDeviceConfigInfo( id, CL_DEVICE_MAX_THREAD_GROUP_SIZE, localThreads, sizeof( cl_uint ), NULL ); - if( err != CL_SUCCESS ){ - log_error( "Unable to get thread group max size: %d", err ); - return -1; - } - if( localThreads[0] > threads[0] ) - localThreads[0] = threads[0]; -#endif - - output_ptr = malloc(objSize * num_elements); - if( ! output_ptr ){ - log_error( " unable to allocate %d bytes for output_ptr\n", (int)(objSize * num_elements) ); - return -1; - } - streams[0] = clCreateBuffer( device, (cl_mem_flags)(CL_MEM_READ_WRITE), objSize * num_elements, NULL ); - if( !streams[0] ){ - log_error( " clCreateBuffer failed\n" ); - free( output_ptr ); - return -1; - } - - err = create_program_and_kernel( device, stream_read_struct_kernel_code, "test_stream_read_struct", &program[0], &kernel[0]); - if( err ){ - clReleaseProgram( program[0] ); - free( output_ptr ); - return -1; - } - - err = clSetKernelArg( kernel[0], 0, sizeof( cl_mem ), (void *)&streams[0] ); - if( err != CL_SUCCESS){ - print_error( err, "clSetKernelArg failed" ); - clReleaseProgram( program[0] ); - clReleaseKernel( kernel[0] ); - clReleaseMemObject( streams[0] ); - free( output_ptr ); - return -1; - } - -#ifdef USE_LOCAL_THREADS - err = clEnqueueNDRangeKernel( queue, kernel[0], 1, NULL, threads, localThreads, 0, NULL, NULL ); -#else - err = clEnqueueNDRangeKernel( queue, kernel[0], 1, NULL, threads, NULL, 0, NULL, NULL ); -#endif - if( err != CL_SUCCESS ){ - print_error( err, "clEnqueueNDRangeKernel failed" ); - clReleaseProgram( program[0] ); - clReleaseKernel( kernel[0] ); - clReleaseMemObject( streams[0] ); - free( output_ptr ); - return -1; - } - - err = clEnqueueReadBuffer( queue, streams[0], true, 0, objSize*num_elements, (void *)output_ptr, 0, NULL, NULL ); - if( err != CL_SUCCESS){ - print_error( err, "clEnqueueReadBuffer failed" ); - clReleaseProgram( program[0] ); - clReleaseKernel( kernel[0] ); - clReleaseMemObject( streams[0] ); - free( output_ptr ); - return -1; - } - - if (verify_read_struct(output_ptr, num_elements)){ - log_error(" struct test failed\n"); - err = -1; - } - else{ - log_info(" struct test passed\n"); - err = 0; - } - - // cleanup - clReleaseProgram( program[0] ); - clReleaseKernel( kernel[0] ); - clReleaseMemObject( streams[0] ); - free( output_ptr ); - - return err; -} -*/ - -