Merged in warning_fix (pull request #62)

Converted AtomicString to constexpr char[]

Approved-by: Matt Feemster
This commit is contained in:
Seth 2022-03-14 05:09:46 +00:00 committed by Matt Feemster
commit 24db55010c
2 changed files with 23 additions and 27 deletions

View File

@ -249,10 +249,7 @@ static constexpr char CarToRasFunctionString[] =
"}\n"
"\n";
static string AtomicString()
{
ostringstream os;
os <<
static constexpr char AtomicString[] =
"void AtomicAdd(volatile __global real_bucket_t* source, const real_bucket_t operand)\n"
"{\n"
" union\n"
@ -273,6 +270,5 @@ static string AtomicString()
" newVal.realVal = prevVal.realVal + operand;\n"
" } while (atomic_cmpxchg((volatile __global atomi*)source, prevVal.intVal, newVal.intVal) != prevVal.intVal);\n"
"}\n";
return os.str();
}
}

View File

@ -334,7 +334,7 @@ string IterOpenCLKernelCreator<T>::CreateIterKernelString(const Ember<T>& ember,
CarToRasFunctionString;
if (lockAccum)
os << AtomicString();
os << AtomicString;
os <<
xformFuncs.str() <<