forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Labels
Graph ImplementationRelated to DPC++ implementation and testingRelated to DPC++ implementation and testingbugSomething isn't workingSomething isn't working
Description
Because of the delayed submission of the lambda functions passed to the sycl::queue
in either mode of graph construction it is possible for a situation to arise where the lambda captures variables which are alive at time of submission to the queue but out of scope at time of graph execution, which causes undefined behaviour and errors when executing a graph. For example:
void run_some_kernel(sycl::queue q, int* data){
// data is captured by ref here but will have gone out of scope when the
// CGF is later run when the graph is executed.
q.submit([&](sycl::handler& h){
// Call some kernel which uses data here
});
}
int main(){
sycl::queue q;
int* someUsmAllocatedPtr;
q.begin_recording();
run_some_kernel(q, someUsmAllocatedPtr);
q.end_recording();
}
This scenario is potentially more common with record and replay but not improbable with the explicit API.
Metadata
Metadata
Assignees
Labels
Graph ImplementationRelated to DPC++ implementation and testingRelated to DPC++ implementation and testingbugSomething isn't workingSomething isn't working