Skip to content

Commit

Permalink
Fix #1392: "syntehsis" of callables
Browse files Browse the repository at this point in the history
Refactor the code that was to catch struct value passing (which is
not yet implemented) from arguments that are callables.

Fix #1392
  • Loading branch information
schweitzpgi committed Mar 14, 2024
1 parent afe840b commit 914c92a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/Optimizer/Transforms/QuakeSynthesizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,18 @@ class QuakeSynthesizer
continue;
}

if (isa<cudaq::cc::CallableType>(type)) {
// TODO: for now we ignore the passing of callable arguments.
continue;
}

// The struct type ends up as a i64 in the thunk kernel args pointer, so
// just skip ahead. TODO: add support for struct types!
if (isa<cudaq::cc::StructType, cudaq::cc::CallableType>(type)) {
if (auto structTy = dyn_cast<cudaq::cc::StructType>(type)) {
if (structTy.isEmpty()) {
// TODO: for now we can ignore empty struct types.
continue;
}
char *ptrToSizeInBuffer = static_cast<char *>(args) + offset;
auto rawSize = *reinterpret_cast<std::uint64_t *>(ptrToSizeInBuffer);
stdVecInfo.emplace_back(argNum, Type{}, rawSize);
Expand Down

0 comments on commit 914c92a

Please sign in to comment.