Kaydet (Commit) 61f3f968 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Avoid OpenCL compilation error when multiple RAND() calls in a formula

Simply surround the Random123 code snippet with an ifdef guard.

Change-Id: I370a3c37226d31bfbe703e5b7936b2180aee1784
üst 1aa1a1c7
...@@ -415,6 +415,10 @@ public: ...@@ -415,6 +415,10 @@ public:
// of course. Only the code that calculates the counter-based // of course. Only the code that calculates the counter-based
// random number and what it needs is left. // random number and what it needs is left.
ss << "\ ss << "\
\n\
#ifndef DEFINED_RANDOM123_STUFF\n\
#define DEFINED_RANDOM123_STUFF\n\
\n\
/*\n\ /*\n\
Copyright 2010-2011, D. E. Shaw Research.\n\ Copyright 2010-2011, D. E. Shaw Research.\n\
All rights reserved.\n\ All rights reserved.\n\
...@@ -712,6 +716,7 @@ threefry2x32 (threefry2x32_ctr_t in, threefry2x32_key_t k)\n\ ...@@ -712,6 +716,7 @@ threefry2x32 (threefry2x32_ctr_t in, threefry2x32_key_t k)\n\
{\n\ {\n\
return threefry2x32_R (threefry2x32_rounds, in, k);\n\ return threefry2x32_R (threefry2x32_rounds, in, k);\n\
}\n\ }\n\
#endif\n\
\n\ \n\
"; ";
ss << "double " << mSymName << "_Random (int seed)\n\ ss << "double " << mSymName << "_Random (int seed)\n\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment