I’m trying to compile some c++ and cuda code. One of my .cpp files calles “helper_time.h”, however, I keep getting the following errors:
/usr/local/cuda-10.2/samples/common/inc/exception.h:92:15: error: expected initializer before ‘<’ token
void Exception<Std_Exception>::throw_it(const char *file, const int line
/usr/local/cuda-10.2/samples/common/inc/exception.h:118:1: error: reference to ‘Exception’ is ambiguous
Exception<Std_Exception>::Exception() : Std_Exception("Unknown Exception.\n") {}
I was able to solve the issue, it was an error in my CMakeLists file, however I am now gettin out of bounds errors:
========= Invalid __global__ read of size 1
========= at 0x00000090 in d_getAvrgErr(float*, uchar4*, int)
========= by thread (15,13,0) in block (5,0,0)
========= Address 0x0004049e is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/aarch64-linux-gnu/tegra/libcuda.so.1 (cuLaunchKernel + 0x218) [0x1f3970
Here’s the function causing the error:
__global__ void d_getAvrgErr(float* d_avrg, uchar4* d_ptr, int W) {
int i = (blockIdx.x<<BLOCK_DIM_2D_RADIX) + threadIdx.x,
j = (blockIdx.y<<BLOCK_DIM_2D_RADIX) + threadIdx.y,
index = j*W + i;
d_ptr += index;
atomicAdd(d_avrg,abs(d_ptr->z-(int)d_ptr->y));
}
How could I prevent an out of bounds error? Btw I’m trying to compile on both a Xavier NX and a TX2 NX