Cuda 5.0: Replacement for Cutil.H

CUDA 5.0: Replacement for cutil.h?

Yes, there is a replacement in the new SDK Examples.
It has been covered in a previous question:
CUDA5 Examples: Has anyone translated some cutil definitions to CUDA5?

Dependencies on cutil when using CUDA 5.0

If you are planning on using CUDA 5 or later, it be necessary to modify the code you are trying compile to remove or replace dependencies on libcutil. That was an unofficial component of the CUDA SDK in version 4 and earlier and has been deprecated and removed from CUDA 5.

The alternative would be to build the code with CUDA 4.2 or to try building the library from the CUDA 4.2 SDK source using the CUDA 5 toolchain. I have no personal experience with the latter and don't know whether it is feasible or not.

Where to find CUDA's cutil_math.h?

The cutil functionality was deleted from the CUDA 5.0 Samples (i.e. the "SDK"). You can still download a previous SDK and compile it under CUDA 5, you should then have everything that came with previous SDK's.

The official notice was given by nvidia in the CUDA 5.0 release notes (CUDA_Samples_Release_Notes.pdf, installed with the samples). As to why, I imagine that the nvidia sentiment regarding cutil probably was something like what is expressed here "not suitable for use in a real application. It is completely unsupported" but people were using it in real applications. So one way to try put a stop to that is to delete it, I suppose. That's just speculation.

Note some additional useful info provided in the release notes:

CUTIL has been removed with the CUDA Samples in CUDA 5.0, and replaced
with helper functions found in NVIDIA_CUDA-5.0/common/inc:
helper_cuda.h, helper_cuda_gl.h, helper_cuda_drvapi.h,
helper_functions.h, helper_image.h, helper_math.h, helper_string.h,
helper_timer.h

These helper functions handle CUDA device
initialization, CUDA error checking, string parsing, image file
loading and saving, and timing functions. The CUDA Samples projects no
longer have references and dependencies to CUTIL, and now use these
helper functions going forward.

So you may find useful functions in some of those header files.

How should a very simple Makefile look like for Cuda compiling under linux

Just in case, here's my variant. I use it to compile CUDA projects on Mac, but I think it will suit Linux too. It requires CUDA SDK.

BINDIR = ./ # places compiled binary in current directory
EXECUTABLE := helloWorld

CCFILES := helloWorld.cpp
CUFILES := helloWorld.cu

# an ugly part - setting rootdir for CUDA SDK makefile
# look for common.mk - I don't know where SDK installs it on Linux -
# and change ROOTDIR accordingly
ROOTDIR := /Developer/GPU\ Computing/C/common

include $(ROOTDIR)/../common/common.mk


Related Topics



Leave a reply



Submit