#pragma once #include #include #include #include #include #define cudaSafeCall(x) x;cudaCheckError() #ifndef NDEBUG #define cudaCheckError() { \ cudaDeviceSynchronize(); \ cudaError_t err=cudaGetLastError(); \ if(err!=cudaSuccess) { \ fprintf(stderr, "Cuda error in file '%s' in line %i : %s.\n", \ __FILE__, __LINE__, cudaGetErrorString( err) ); \ exit(EXIT_FAILURE); \ } \ } #else /* DPCT1010:28: SYCL uses exceptions to report errors and does not use the error codes. The call was replaced with 0. You need to rewrite this code. */ /* DPCT1009:29: SYCL uses exceptions to report errors and does not use the error codes. The original code was commented out and a warning string was inserted. You need to rewrite this code. */ #define cudaCheckError() \ { int err = 0; } #endif /* Given a number of bytes, nbytes, and a byte alignment, align, (e.g., 2, * 4, 8, or 16), return the smallest integer that is larger than nbytes and * a multiple of align. */ #define PAD_DIV(nbytes, align) (((nbytes) + (align) - 1) / (align)) #define PAD(nbytes, align) (PAD_DIV((nbytes),(align)) * (align)) #if defined(_WIN64) || defined(__LP64__) // 64-bit pointer operand constraint for inlined asm #define _ASM_PTR_ "l" #else // 32-bit pointer operand constraint for inlined asm #define _ASM_PTR_ "r" #endif // Function to print a vector template void printVector(const char* label, const vector &v) { std::cout << label << ": "; for(int i=0;i