mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-01-21 13:10:04 -05:00
Converted AtomicString to constexpr char[]
This commit is contained in:
parent
94c3e6bed3
commit
5605faeed7
@ -249,30 +249,26 @@ static constexpr char CarToRasFunctionString[] =
|
|||||||
"}\n"
|
"}\n"
|
||||||
"\n";
|
"\n";
|
||||||
|
|
||||||
static string AtomicString()
|
static constexpr char AtomicString[] =
|
||||||
{
|
"void AtomicAdd(volatile __global real_bucket_t* source, const real_bucket_t operand)\n"
|
||||||
ostringstream os;
|
"{\n"
|
||||||
os <<
|
" union\n"
|
||||||
"void AtomicAdd(volatile __global real_bucket_t* source, const real_bucket_t operand)\n"
|
" {\n"
|
||||||
"{\n"
|
" atomi intVal;\n"
|
||||||
" union\n"
|
" real_bucket_t realVal;\n"
|
||||||
" {\n"
|
" } newVal;\n"
|
||||||
" atomi intVal;\n"
|
"\n"
|
||||||
" real_bucket_t realVal;\n"
|
" union\n"
|
||||||
" } newVal;\n"
|
" {\n"
|
||||||
"\n"
|
" atomi intVal;\n"
|
||||||
" union\n"
|
" real_bucket_t realVal;\n"
|
||||||
" {\n"
|
" } prevVal;\n"
|
||||||
" atomi intVal;\n"
|
"\n"
|
||||||
" real_bucket_t realVal;\n"
|
" do\n"
|
||||||
" } prevVal;\n"
|
" {\n"
|
||||||
"\n"
|
" prevVal.realVal = *source;\n"
|
||||||
" do\n"
|
" newVal.realVal = prevVal.realVal + operand;\n"
|
||||||
" {\n"
|
" } while (atomic_cmpxchg((volatile __global atomi*)source, prevVal.intVal, newVal.intVal) != prevVal.intVal);\n"
|
||||||
" prevVal.realVal = *source;\n"
|
"}\n";
|
||||||
" newVal.realVal = prevVal.realVal + operand;\n"
|
|
||||||
" } while (atomic_cmpxchg((volatile __global atomi*)source, prevVal.intVal, newVal.intVal) != prevVal.intVal);\n"
|
|
||||||
"}\n";
|
|
||||||
return os.str();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -334,7 +334,7 @@ string IterOpenCLKernelCreator<T>::CreateIterKernelString(const Ember<T>& ember,
|
|||||||
CarToRasFunctionString;
|
CarToRasFunctionString;
|
||||||
|
|
||||||
if (lockAccum)
|
if (lockAccum)
|
||||||
os << AtomicString();
|
os << AtomicString;
|
||||||
|
|
||||||
os <<
|
os <<
|
||||||
xformFuncs.str() <<
|
xformFuncs.str() <<
|
||||||
|
Loading…
Reference in New Issue
Block a user