Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/trace/call.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ template <typename T> class ObjectTracker {
}

uint64_t get(const T& obj) const {
if constexpr (std::is_same_v<T, cl_platform_id>) {
if constexpr (std::is_same_v<T, cl_platform_id> ||
std::is_same_v<T, cl_context>) {
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,
Expand Down
7 changes: 6 additions & 1 deletion src/trace/visitor-srcgen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,12 @@ int main(int argc, char* argv[]) {
// Declare var to serve as input parameter
if (static_cast<int64_t>(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);
Expand Down