Monday, April 8, 2013

.cpp have to be changed to .cu if use CUDA syntax

 

syntax such as: myKernel<<<1, 2>>>(my_objects_d);

This is even if you have already changed the file to have ‘Item Type’ CUDA C/C++

VS2010 Nsight non-CUDA to CUDA project

 

Remember to check your project properties

-> Linker –> Input –> Additional Dependencies

if “cudart.lib;” is not there, should add it, this will ‘pull in’ extra dependencies for CUDA compiler ONCE for all

 

sometimes it may seems to work even without it, it is because those dependencies were ‘pulled in’ already for some reason.

Sunday, April 7, 2013

NSight, CUDA Toolkit, and driver version matches for VS2010

 

NSight 2.2 – CUDA SDK 4.0, 4.1 and 4.2 – Driver 301.42 or newer

https://developer.nvidia.com/rdp/nsight-visual-studio-edition-downloads

 

NSight 3.0 – CUDA SDK 5.0, 4.2 and 4.1 – Driver 306.94 or newer

https://developer.nvidia.com/rdp/nsight-visual-studio-edition-early-access

 

Otherwise, it won’t build, even after you add the seemingly correct Build Customization options

Wednesday, March 27, 2013

The best design is the one that you don’t need to explain to the others

 

Yeah, like we need another pretentious debate about some pretentious concept de grandeur.

This one though, someone’s going prove it for good.

The ego of a computer scientist

 

is larger than the ones of all EE, Material, Telecom, Chemical, Structural and Mechanical Engineers combined.

For no bloody reason…

Tuesday, March 12, 2013

[c/c++] use reference variable to set values


    ExpandedVertex& beforeVec = (*m_hVecGlobalVecRef)[i];

    beforeVec.pos.x = temp_hPos[i*4] ;
    beforeVec.pos.y = temp_hPos[i*4+1];
    beforeVec.pos.z = temp_hPos[i*4+2];
    beforeVec.mass = temp_hPos[i*4+3];

    beforeVec.vel.x = temp_hVel[i*4];
    beforeVec.vel.y = temp_hVel[i*4+1];
    beforeVec.vel.z = temp_hVel[i*4+2];
    beforeVec.mass = temp_hVel[i*4+3];

Saturday, March 9, 2013