summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-emit-cpp.cpp23
-rw-r--r--source/slang/slang-emit-cuda.cpp10
2 files changed, 25 insertions, 8 deletions
diff --git a/source/slang/slang-emit-cpp.cpp b/source/slang/slang-emit-cpp.cpp
index 99d1fbf22..f3d16444a 100644
--- a/source/slang/slang-emit-cpp.cpp
+++ b/source/slang/slang-emit-cpp.cpp
@@ -1166,8 +1166,18 @@ void CPPSourceEmitter::_emitConstructConvertDefinition(const UnownedStringSlice&
{
writer->emit(", \n");
}
- writer->emit(rowTypeName);
- writer->emit("{ ");
+
+ if (m_target == CodeGenTarget::CUDASource)
+ {
+ m_writer->emit("make_");
+ writer->emit(rowTypeName);
+ m_writer->emit("(");
+ }
+ else
+ {
+ writer->emit(rowTypeName);
+ writer->emit("{ ");
+ }
}
for (int j = 0; j < dim.colCount; ++j)
@@ -1184,7 +1194,14 @@ void CPPSourceEmitter::_emitConstructConvertDefinition(const UnownedStringSlice&
}
if (dim.rowCount > 1)
{
- writer->emit("}");
+ if (m_target == CodeGenTarget::CUDASource)
+ {
+ writer->emit(")");
+ }
+ else
+ {
+ writer->emit("}");
+ }
}
}
diff --git a/source/slang/slang-emit-cuda.cpp b/source/slang/slang-emit-cuda.cpp
index 019bf8b94..c628e5caf 100644
--- a/source/slang/slang-emit-cuda.cpp
+++ b/source/slang/slang-emit-cuda.cpp
@@ -37,12 +37,12 @@ static bool _isSingleNameBasicType(IROp op)
case kIROp_Int8Type: return UnownedStringSlice("char");
case kIROp_Int16Type: return UnownedStringSlice("short");
case kIROp_IntType: return UnownedStringSlice("int");
- case kIROp_Int64Type: return UnownedStringSlice("long long");
+ case kIROp_Int64Type: return UnownedStringSlice("longlong");
- case kIROp_UInt8Type: return UnownedStringSlice("unsigned char");
- case kIROp_UInt16Type: return UnownedStringSlice("unsigned short");
- case kIROp_UIntType: return UnownedStringSlice("unsigned int");
- case kIROp_UInt64Type: return UnownedStringSlice("unsigned long long");
+ case kIROp_UInt8Type: return UnownedStringSlice("uchar");
+ case kIROp_UInt16Type: return UnownedStringSlice("ushort");
+ case kIROp_UIntType: return UnownedStringSlice("uint");
+ case kIROp_UInt64Type: return UnownedStringSlice("ulonglong");
// Not clear just yet how we should handle half... we want all processing as float probly, but when reading/writing to memory converting
case kIROp_HalfType: return UnownedStringSlice("half");