FangQ

does 4650 support double precision float?

Discussion created by FangQ on Mar 2, 2009
Latest reply on Mar 3, 2009 by michael.chu

The following code printed very strange outputs (either zeros or huge numbers) with my HD 4650 card. If I replace all double to float, or set BRT_RUNTIME to cpu, the results look ok.

 

can anyone tell me what's wrong with this code? or it is SDK 1.3's bug?

 

#include <stdio.h>
#include <stdlib.h>

kernel void copy(double seed<>,out double res<>{
    res=seed;
}

int main(int argc, char**argv){
    double v[100];
    double output[100];
    int randlen=100,i;
    int iteration=1000;

    double gseed<100>;
    double gres<100>;

    for(i=0;i<100;i++)
        v=i ;
      
    streamRead(gseed, v);
    copy(gseed,gres);
    streamWrite(gres,output);
       
    for(i=0;i<100;i++)
            printf("%d:%f\n",i,output
);
}

Outcomes