MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / runAutoTest

Function runAutoTest

cpp/0_Introduction/simpleTexture3D/simpleTexture3D.cpp:298–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298void runAutoTest(const char *ref_file, char *exec_path)
299{
300 checkCudaErrors(cudaMalloc((void **)&d_output, width * height * sizeof(GLubyte) * 4));
301
302 // render the volumeData
303 render_kernel(gridSize, blockSize, d_output, width, height, w);
304
305 checkCudaErrors(cudaDeviceSynchronize());
306 getLastCudaError("render_kernel failed");
307
308 void *h_output = malloc(width * height * sizeof(GLubyte) * 4);
309 checkCudaErrors(cudaMemcpy(h_output, d_output, width * height * sizeof(GLubyte) * 4, cudaMemcpyDeviceToHost));
310 sdkDumpBin(h_output, width * height * sizeof(GLubyte) * 4, "simpleTexture3D.bin");
311
312 bool bTestResult = sdkCompareBin2BinFloat("simpleTexture3D.bin",
313 sdkFindFilePath(ref_file, exec_path),
314 width * height,
315 MAX_EPSILON_ERROR,
316 THRESHOLD,
317 exec_path);
318
319 checkCudaErrors(cudaFree(d_output));
320 free(h_output);
321
322 sdkStopTimer(&timer);
323 sdkDeleteTimer(&timer);
324
325 exit(bTestResult ? EXIT_SUCCESS : EXIT_FAILURE);
326}
327
328void loadVolumeData(char *exec_path)
329{

Callers 1

mainFunction · 0.70

Calls 5

sdkDumpBinFunction · 0.85
sdkCompareBin2BinFloatFunction · 0.85
sdkFindFilePathFunction · 0.85
sdkStopTimerFunction · 0.85
sdkDeleteTimerFunction · 0.85

Tested by

no test coverage detected