How to return a single variable from a CUDA kernel function?
        Posted  
        
            by Pooya
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Pooya
        
        
        
        Published on 2010-04-12T00:33:31Z
        Indexed on 
            2010/04/12
            0:43 UTC
        
        
        Read the original article
        Hit count: 388
        
I have a CUDA search function which calculate one single variable. How can I return it back.
global void G_SearchByNameID(node* Node, long nodeCount, long start,char* dest, long answer){ answer = 2; }
cudaMemcpy(h_answer, d_answer, sizeof(long), cudaMemcpyDeviceToHost); cudaFree(d_answer);
for both of these lines I get this error: error: argument of type "long" is incompatible with parameter of type "const void *"
© Stack Overflow or respective owner