开发者

error: identifier "float3" is undefined; When running oclNbody demo on ATI card

开发者 https://www.devze.com 2023-03-13 08:24 出处:网络
I\'m trying to run NVidia\'s OpenCL demo oclNbody.exe on ATI Radeo 4850 card and receive such errors:

I'm trying to run NVidia's OpenCL demo oclNbody.exe on ATI Radeo 4850 card and receive such errors:

Build Log: C:\DOCUME~1\DIMEDR~1\LOCALS~1\Temp\OCL27C.tmp.cl(33): error: identifier

      "float3" is undefined

REAL3 bodyBodyInteraction(REAL3 ai, REAL4 bi, REAL4 bj, REAL softeningSquared)

^

And so on for all REAL3 datatype using. I have开发者_JS百科 seen the OpenCL specification 1.1 and it clearly says that float3 is supported. I've tried to change REAL3 with float3 with no luck. I have the latest drivers for my card. Using Windows XP SP3 OS

How can I fix or work around this error?


float3 and other 3-component vector types were not part of the OpenCL 1.0 spec; they were added in the 1.1 revision. According to AMD's driver compatibility page, the Radeon HD 4800 cards only support OpenCL 1.0.

The fact that the compiler tried to interpret float3 as an identifier shows that it is not a recognized type.


I have found a workaround:

  • use float 4 instead of float3;
  • #define ZERO4 {0.0f, 0.0f, 0.0f, 0.0f} and use it instead ZERO3
  • and decrease the number of workgroup to 64 (was 256)

and it worked!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号