diff --git a/src/trace/call.hpp b/src/trace/call.hpp index f1f10e3..2eb7149 100644 --- a/src/trace/call.hpp +++ b/src/trace/call.hpp @@ -47,11 +47,13 @@ template class ObjectTracker { } uint64_t get(const T& obj) const { - if constexpr (std::is_same_v) { + if constexpr (std::is_same_v || + std::is_same_v) { if (obj == nullptr) { return -1; } } + if (m_objects.find(obj) != m_objects.end()) { auto val = m_objects.at(obj); debug("Object Tracker: getting instance for %p => #%llu\n", obj, diff --git a/src/trace/visitor-srcgen.hpp b/src/trace/visitor-srcgen.hpp index 6d3e675..d6f70dd 100644 --- a/src/trace/visitor-srcgen.hpp +++ b/src/trace/visitor-srcgen.hpp @@ -392,7 +392,12 @@ int main(int argc, char* argv[]) { // Declare var to serve as input parameter if (static_cast(ids[0]) == -1) { assert(ttype == - CALL_PARAM_TEMPLATE_TYPE_CL_PLATFORM_ID); + CALL_PARAM_TEMPLATE_TYPE_CL_PLATFORM_ID || + ttype == CALL_PARAM_TEMPLATE_TYPE_CL_CONTEXT); + pstr = "nullptr"; + } else if (ids.empty()) { + assert(ttype == CALL_PARAM_TEMPLATE_TYPE_CL_DEVICE_ID || + ttype == CALL_PARAM_TEMPLATE_TYPE_CL_EVENT); pstr = "nullptr"; } else { auto pvar = makeCallParamVarName(param_num);