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

View File

@ -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() <<