Skip to content

Commit 7e78231

Browse files
committed
address comments
1 parent 3d7233e commit 7e78231

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

runtime/common/CompiledKernel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ cudaq::CompiledKernel::execute(const std::vector<void *> &rawArgs) const {
3434
return reinterpret_cast<KernelThunkResultType (*)(void *, bool)>(funcPtr)(
3535
buff, /*client_server=*/false);
3636
}
37-
if (jitRepr && jitRepr->argsCreator) {
37+
if (!isFullySpecialized()) {
3838
void *buff = nullptr;
3939
jitRepr->argsCreator(static_cast<const void *>(rawArgs.data()), &buff);
4040
reinterpret_cast<KernelThunkResultType (*)(void *, bool)>(funcPtr)(
@@ -48,7 +48,7 @@ cudaq::CompiledKernel::execute(const std::vector<void *> &rawArgs) const {
4848
}
4949

5050
cudaq::KernelThunkResultType cudaq::CompiledKernel::execute() const {
51-
if (jitRepr && jitRepr->argsCreator)
51+
if (!isFullySpecialized())
5252
throw std::runtime_error(
5353
"Kernel has unspecialized parameters; call execute(rawArgs) instead.");
5454
if (!resultInfo.hasResult()) {

runtime/common/CompiledKernel.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ class CompiledKernel {
133133
const MlirRepr &getMlir() const;
134134

135135
std::string name;
136-
ResultInfo resultInfo;
136+
ResultInfo resultInfo; // TODO: we might want to store the entire kernel
137+
// signature here. Though I'm not sure what MLIR
138+
// agnostic information is worth storing.
137139
std::optional<JitRepr> jitRepr;
138140
std::optional<MlirRepr> mlirRepr;
139141
};

0 commit comments

Comments
 (0)