This project is read-only.

Error: function "hypotf" was referenced but not defined

Feb 6, 2013 at 11:09 AM
Hi, All!
My code work in the Emulator mode on the one computer which don't have CUDA GPU. But same code doesn't work on the other computer with CUDA GPU in the Device mode and in the Emulator mode too. VS 2010 show me next message:
"Compilation error CUDAFYSOURCETEMP.cu C:\program files\nvidia gpu computing toolkit\cuda\v5.0\include\math_functions.h(2900): error: function "hypotf" was referenced but not defined"

How is fix?
Feb 7, 2013 at 10:28 AM
Hi Alex,
Can you post your code?
Please take a look here http://stackoverflow.com/questions/13396878/cuda-visual-studio-2010-express-build-error for possibility of more info. If you resolve your issue then please let us know!
Nick
Feb 7, 2013 at 5:55 PM
Oh, i forgot about code. This is part of my code:
//Determine the platform
CudafyModes.Target = eGPUType.Cuda;
GPGPU gpu = CudafyHost.GetDevice(CudafyModes.Target);

//Get GPU Property
GPGPUProperties property = gpu.GetDeviceProperties(true);

//Translate kernel on NET to C for CUDA and
//create XML file - module for use after it
CudafyModule km = CudafyTranslator.Cudafy();
Error occurs on last string. And I have to translate the code on one PC, and the other PC only upload a file (CUDAfy module) like this:
CudafyModule km = CudafyModule.Deserialize(filePath);
And...i seen this page on stackoverflow and it didn't help for me.

PS: Sorry for my english
Feb 8, 2013 at 12:38 PM
I need to see the code that was cudafied (the method with the Cudafy attribute). Also show the translated code in the file CUDAFYSOURCETEMP.cu.
Feb 8, 2013 at 9:50 PM
there..
 [Cudafy]
        public static void IBIndicationsToVector(GThread thread, int[] Indication_Pos_Ch1, int[] Indication_ToF_Ch1, float[] Res_Ch1)
        {
            int tid = thread.threadIdx.x;
            if (tid < indication_Size)
                Res_Ch1[(Indication_ToF_Ch1[tid] * numOfCol) - numOfCol + Indication_Pos_Ch1[tid]] = 0.1f;
        }
and CUDAFYSOURCETEMP.cu.
// TestGPUConsole2.TestCudaFunc
extern "C" __global__ void IBIndicationsToVector(int* Indication_Pos_Ch1, int Indication_Pos_Ch1Len0, int* Indication_ToF_Ch1, int Indication_ToF_Ch1Len0, float* Res_Ch1, int Res_Ch1Len0);

// TestGPUConsole2.TestCudaFunc
extern "C" __global__ void IBIndicationsToVector(int* Indication_Pos_Ch1, int Indication_Pos_Ch1Len0, int* Indication_ToF_Ch1, int Indication_ToF_Ch1Len0, float* Res_Ch1, int Res_Ch1Len0)
{
    int x = threadIdx.x;
    if (x < 300)
    {
        Res_Ch1[(Indication_ToF_Ch1[(x)] * 200 - 200 + Indication_Pos_Ch1[(x)])] = 0.1;
    }
}
Feb 9, 2013 at 9:42 AM
I don't see where you make use of any function that needs hypotf. Can you get anything for CUDAfy to run on GPU? Like the example projects? If not then it strong suggests something is amiss with your CUDA set-up. This is why I thought the link I gave may have been useful.
Feb 9, 2013 at 6:18 PM
Even empty CUDAfy function gives error and in emulator mode too. But the same code compiled on another PC running on this PC. And samples by NVidia working fine.
Feb 14, 2013 at 6:56 PM
In emulator mode the cudafying step remains unchanged so it is not unexpected that behaviour is the same. There must be something with your set-up that is causing this. Can you compare the nvcc command line called by cudafy and compare with that used by a working CUDA example?
Feb 18, 2013 at 6:03 PM
Oh, sorry, I looked at the nvcc.profile again and realized the mistake.
PATH            += $(TOP)/extools/bin;C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin;$(TOP)/open64/bin;$(TOP)/nvvm;$(_HERE_);$(TOP)/lib;
INCLUDES        +=  "-I$(TOP)/include" "-I$(TOP)/include/cudart" "-IC:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/include" $(_SPACE_)
In PATH and INCLUDES option are different versions of Visual Studio. It's a reason of error.