nulltorpedo
nulltorpedo

Reputation: 1215

Cuda error C2054: expected '(' to follow '__device__'

The file is named with .cu extension. It is complaining about my device function definitions... What other information do you need?

d.cu(96): error C2054: expected '(' to follow '__device__'
d.cu(96): error C2085: 'distance' : not in formal parameter list
d.cu(96): error C2143: syntax error : missing ';' before '{'

Actual function at line 96: (Float2d is a struct)

__device__ 
float distance(Float2d A, Float2d B){
return sqrtf( (A.x-B.x)*(A.x-B.x) + (A.y-B.y)*(A.y-B.y) );
}

Upvotes: 1

Views: 1204

Answers (1)

nulltorpedo
nulltorpedo

Reputation: 1215

Found the problem: For some reason (a while back) I had included the .cu file in the .c file. Don't know why/how maybe I was drunk. So this was an ID:107 error.

Upvotes: 2

Related Questions