| 296 | } |
| 297 | |
| 298 | void 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 | |
| 328 | void loadVolumeData(char *exec_path) |
| 329 | { |
no test coverage detected