CutFindFilePath? :s Look inside

hi,

Don’t shoot me plz, i’m new here :)

When i compile this code, I get a strange error

The location of jorn.dat is C:\Documents and Settings\Djorn\Bureaublad\123\NVIDIA CUDA SDK\projects\dwtHaar1D\sd\jorn.dat

The location of s_fname.dat is C:\Documents and Settings\Djorn\Bureaublad\123\NVIDIA CUDA SDK\projects\dwtHaar1D\data\s_fname.dat

The location of jorn.dat and s_fname is not the same! (sd\jorn.dat and data\s_fname.dat)

Code:

char* s_fname;

char* jorn;

s_fname = cutFindFilePath(“signal.dat”, argv[0]);

s_jorn = cutFindFilePath(“jorn.dat”, argv[0]);

Results:

argv[0] = “c:\Documents and Settings\Djorn\Bureaublad\dwtHaar1D\NVIDIA CUDA SDK\bin\win32\EmuDebug\dwtHaar1D.exe”

s_fname = “data/signal.dat”

s_jorn = 0x00000000

why didn’t he find the file jorn.dat? Is there a rule that a forget? Or something else?

This code is SDK example of 1DHAAR Wavelets

Thx,

hello. I am a student. I also meet the same question. Have you solved the question. if so,please replay to me. my email is wlpscu@yahoo.cn.Thank you!

hi,you must ceate a folder that name is “data”,and copy .cubin file in to.

I think that this function is not so good of nvida. External Image

Indeed, they never intended it to be good. cut* funtions are designed only to be used within the SDK and are not meant to be used in user applications. Check the last several dozen posts by tmurray from NVIDIA for the same message over and over again…

I wonder–do people use cutil because we don’t tell them not to explicitly, they see that it’s in the “SDK” and think that it’s actually a part of the CUDA APIs, or are they just using SDK samples verbatim as a starting point?

(one and two are easily solved, three is harder, so if you have opinions, you should let me know…)

I don’t doubt that three is the major source of the problem. For many it appears to be easier to start hacking on the SDK samples that it is to actually read the documentation, especially for those with patchy or non-existent C/C++ chops. Anything you put into the SDK samples (for better or worse) becomes part of the CUDA lingua franca, no matter how broken or bad it is. I would personally put the SDK build system in the same category as cutil.

I started by copying/pasting parts of code from the SDK, specifically the timing and error checking. It was quick, easy and did exactly what I needed…

It makes sense that the SDK shouldn’t be used, but I don’t believe that is explicitly stated anywhere except for the forums…

The build system and cutil from the SDK should not be used by anyone. Maybe I need to talk to the SDK maintainers and have them insert that in the documentation/etc.

Or perhaps:

#ifndef TMURRAY_WILL_COME_HUNT_ME_DOWN

#error cutil is not for use outside the SDK!

endif

I think part of it is convenience - providing the timer routines and SAFE_CALL macros can help speed up initial development (if you’re writing a code from scratch). Also, consider this… the CUDA SDK build system looks scary! The SDK build examples are quite hairy, yet (I think) they are the only concrete examples anywhere in the CUDA package. So it makes sense to build Makefiles off common.mk in the SDK. Doing so immediately gives access to cutil. Perhaps a full “Hello World!” SDK example (in practice, a saxpy or similar), completely independent of the main SDK examples would be very helpful. It could demonstrate emulation and release modes too (via makefile switch).

yeah, I like that idea. will try to get it into the next version.

This is a side point, but I think people would be a lot less confused if the SDK were renamed to something like “CUDA Example Code” or something else. I was initially confused to learn that one does not need or even use the CUDA Software Development Kit to develop CUDA software. :)

don’t worry, you are preaching to the pope :)