Kernel not running to completion and not returning any error

In the below code my kernel stops running when it reaches ray constructor call. I know this since if I add printf just before and after the call only the ones before print to the console. Can anyone help me figure out why?.

global_ void init_Frame_Buffer(Vec3* Frame_Buffer, Vec3 lower_left, Vec3 horizontal, Vec3 vertical, Vec3 origin) {

        int x = threadIdx.x + blockIdx.x * blockDim.x;
        int y = threadIdx.y + blockIdx.y * blockDim.y;
        int p = y * width + x;
        float u = (float)(x) / width;
        float v = (float)(y) / height;
    
        if (x < width && y < height ) {
            ray r(Origin, lower_left + horizontal * u + vertical * v, false);
            r.colour() = ray_color(r);
            Frame_Buffer[p] = r.colour();
        
        }

    


    }