Unverified Commit b2d3359a authored by David Clark's avatar David Clark Committed by GitHub
Browse files

Adds change for duplicate variables (#3065)


Co-authored-by: default avatarDavid Clark <daclark@nvidia.com>
parent 59b8afb1
......@@ -489,10 +489,13 @@ CUmodule CudaContext::createModule(const string source, const map<string, string
if (!options.empty())
src << "// Compilation Options: " << options << endl << endl;
for (auto& pair : compilationDefines) {
src << "#define " << pair.first;
if (!pair.second.empty())
src << " " << pair.second;
src << endl;
// Query defines to avoid duplicate variables
if (defines.find(pair.first) == defines.end()) {
src << "#define " << pair.first;
if (!pair.second.empty())
src << " " << pair.second;
src << endl;
}
}
if (!compilationDefines.empty())
src << endl;
......
......@@ -572,10 +572,13 @@ cl::Program OpenCLContext::createProgram(const string source, const map<string,
if (!options.empty())
src << "// Compilation Options: " << options << endl << endl;
for (auto& pair : compilationDefines) {
src << "#define " << pair.first;
if (!pair.second.empty())
src << " " << pair.second;
src << endl;
// Query defines to avoid duplicate variables
if (defines.find(pair.first) == defines.end()) {
src << "#define " << pair.first;
if (!pair.second.empty())
src << " " << pair.second;
src << endl;
}
}
if (!compilationDefines.empty())
src << endl;
......
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