Skip to content

[SYCL] Workaround for users with a lot of host accessors. #2296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
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
17 changes: 16 additions & 1 deletion sycl/source/detail/scheduler/graph_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,22 @@ Scheduler::GraphBuilder::getOrInsertMemObjRecord(const QueueImplPtr &Queue,
if (nullptr != Record)
return Record;

const size_t LeafLimit = 8;
static size_t LeafLimit = 0;

if (!LeafLimit) {
if (const char *Val = std::getenv("SYCL_LEAF_LIMIT"))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use sycl config

try {
LeafLimit = std::stoul(Val);
} catch (...) {
throw invalid_parameter_error(
"Invalid value for SYCL_LEAF_LIMIT environment variable",
PI_INVALID_VALUE);
}

if (!LeafLimit)
LeafLimit = 8;
}

MemObject->MRecord.reset(
new MemObjRecord{Queue->getContextImplPtr(), LeafLimit});

Expand Down