Suggestion for nvcc Autocasting of void

Someone is going to bite my head off for this one:

I get a hard error from nvcc:
“./xxx_kernel.cu”, line 417: error: a value of type “void *” cannot be
assigned to an entity of type “uint *”
array = malloc((1 + blockDim.x) * sizeof(uint));

Now I think it should autocast void with exactly the same rules used for parameter passing. I don’t have a copy of the ANSI spec on my desk, but I am sure it should work this way. At the very least it should be just a warning, not a hard error (gcc still does not get it right if there are const/volatile qualifiers buried in the type indirections).

IMHO any cast in a C program needs a paragraph written in the comments justifying its use.

yes malloc() was called from a test wrapper in emu mode

Eric

nvcc is using a c++ preprocessor/parser, so you will need to do the cast by hand.

You will get the same error in g++.

From the release notes:

Sounds like a “quick and dirty” to me. Are you allowed to share with us why?

Thought I had read the release notes, certainly did not expect there to be another different set other than those called “ReleaseNotes” in the unpacked SDK! Perhaps you could put an explicit pointer in the packaged ones to the web site or better, include everything in the package.

Thanks, Eric

I think it is related to the parsing of the kernel execution configurations.

We will try to improve the packaging.