views:

49

answers:

1

I have a struct defined as

struct sData{ 
idx * id; 
int * stime; 
bool * result;  
unsigned int N;
};

Then the code that uses it in

numeric compute(numeric e, sData swabs){
  numeric cache=0.0;
  int sid=0;
  while(sid<swabs.N){
    if(swab.result[sid]) 
      cache += log(e);
    else cache += log(1.0-e);
    sid += 1;
  }
  return cache;
}

but when compiling I get the error.

paug_cuda.cu(602): error: expression must have class type

What is this supposed to mean. what class type? I'm using a bool in a logical expression. what else could there be to this. What am I missing?

+4  A: 

swab -> swabs :)

The error means that you wrote something like X.Y and X is not an instance of a class/struct.

Armen Tsirunyan
AHH thank you. Very frustrating typo.
Andrew Redd
@Halpo : You might want to mark the answer as 'accepted', if it solved your problem.
Mads Elvheim
There is a time limit, from when you submit the question. I was trying. It is marked now.
Andrew Redd