[SOLVED] errors while compiling a custom kernel

Hi

I made a custom kernel
like below

#include "cuda.h"
//-------------------------------- GVDB Includes
#define CUDA_PATHWAY
#include "cuda_gvdb_scene.cuh"
// GVDB Scene
#include "cuda_gvdb_nodes.cuh"
// GVDB Node structure
#include "cuda_gvdb_geom.cuh"
// GVDB Geom helpers
#include "cuda_gvdb_operators.cuh"
// GVDB Operator macros
//--------------------------------

__device__ float
gDensity;
__global__ void myDensityFunc ( int3 res, uchar chan )
{
GVDB_COPY_SMEM_UC
// macro to setup neighbors
uchar v = tex3D<uchar>( volIn[chan], vox.x,vox.y,vox.z);
if ( v==0 ) return;
// return if
surf3Dwrite ( gDensity, volOut[0],
vox.x*sizeof(float), vox.y, vox.z);
}

and then compiled it using the following compile line.

nvcc -ccbin g++ -m64 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_52,code=sm_52  -I./ -I/usr/local/gvdb/include -I/usr/local/cuda-8.0/include -o kernels.o kernels.cu

which gave me a lot of errors like this

/usr/local/gvdb/include/cuda_gvdb_nodes.cuh(136): error: too few arguments in function call

/usr/local/gvdb/include/cuda_gvdb_nodes.cuh(136): error: no operator "-" matches these operands
            operand types are: int3 - int3

/usr/local/gvdb/include/cuda_gvdb_nodes.cuh(137): error: no suitable conversion function from "int3" to "float" exists

/usr/local/gvdb/include/cuda_gvdb_nodes.cuh(137): error: too few arguments in function call

/usr/local/gvdb/include/cuda_gvdb_nodes.cuh(137): error: no suitable conversion function from "int3" to "float" exists

/usr/local/gvdb/include/cuda_gvdb_nodes.cuh(137): error: too few arguments in function call

/usr/local/gvdb/include/cuda_gvdb_nodes.cuh(137): error: no operator "+" matches these operands
            operand types are: float3 + float3

/usr/local/gvdb/include/cuda_gvdb_nodes.cuh(146): error: too few arguments in function call

Can someone advise on what i might be missing?

with kind regards
Rohit

Hi

I have been able to reduce the errors but now i see errors in the

/usr/local/gvdb/include/cuda_gvdb_nodes.cuh

I am wondering if anyone else also has seen such errors?

nvcc --ptx -I. -I/usr/local/gvdb/include kernels.cu 
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/usr/local/gvdb/include/cuda_gvdb_nodes.cuh(185): error: no operator "*" matches these operands
            operand types are: int3 * float3

/usr/local/gvdb/include/cuda_gvdb_nodes.cuh(226): error: no operator "*" matches these operands
            operand types are: int3 * float3

/usr/local/gvdb/include/cuda_gvdb_geom.cuh(30): error: identifier "floor3" is undefined

/usr/local/gvdb/include/cuda_gvdb_operators.cuh(304): error: no instance of overloaded function "make_int3" matches the argument list
            argument types are: (uchar4)

/usr/local/gvdb/include/cuda_gvdb_operators.cuh(305): error: no instance of overloaded function "make_int3" matches the argument list
            argument types are: (uchar4)

/usr/local/gvdb/include/cuda_gvdb_operators.cuh(306): error: no instance of overloaded function "make_int3" matches the argument list
            argument types are: (uchar4)

/usr/local/gvdb/include/cuda_gvdb_operators.cuh(307): error: no instance of overloaded function "make_int3" matches the argument list
            argument types are: (uchar4)

/usr/local/gvdb/include/cuda_gvdb_operators.cuh(308): error: no instance of overloaded function "make_int3" matches the argument list
            argument types are: (uchar4)

/usr/local/gvdb/include/cuda_gvdb_operators.cuh(309): error: no instance of overloaded function "make_int3" matches the argument list
            argument types are: (uchar4)

/usr/local/gvdb/include/cuda_gvdb_operators.cuh(310): error: no instance of overloaded function "make_int3" matches the argument list
            argument types are: (uchar4)

kernels.cu(19): warning: variable "svox" was set but never used

10 errors detected in the compilation of "/tmp/tmpxft_00005a92_00000000-7_kernels.cpp1.ii".

Kindly advise. Is it because i have the master branch pulled out?

with kind regards
Rohit

The errors were fixed if you include cuda_math.cuh in your .cu file.