- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
My understanding of the cl::sycl::context is that they are used among the different devices on a system. For example, I can only access memory allocated on a given cl::sycl::device using a cl::sycl::queue that was instantiated with the cl::sycl::context associated to said device, i.e. using cl::sycl::device::get_context().
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Hi,
Thanks for reaching out to us!
My understanding of the cl::sycl::context is that they are used among the different devices on a system. For example, I can only access memory allocated on a given cl::sycl::device using a cl::sycl::queue that was instantiated with the cl::sycl::context associated to said device, i.e. using cl::sycl::device::get_context().
When you create multiple queues even with the same device, multiple contexts get created. As they are two different SYCL contexts and any buffer you create will be a part of that context.
Could you please send us a sample code/ pseudo code if possible which depicts the problem statement that you are trying to solve.
Thanks & Regards
Goutham
Lien copié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Hi,
Thanks for reaching out to us!
My understanding of the cl::sycl::context is that they are used among the different devices on a system. For example, I can only access memory allocated on a given cl::sycl::device using a cl::sycl::queue that was instantiated with the cl::sycl::context associated to said device, i.e. using cl::sycl::device::get_context().
When you create multiple queues even with the same device, multiple contexts get created. As they are two different SYCL contexts and any buffer you create will be a part of that context.
Could you please send us a sample code/ pseudo code if possible which depicts the problem statement that you are trying to solve.
Thanks & Regards
Goutham
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Hi,
Could you please confirm if your issue is resolved?
If not, provide us a sample code/ pseudo code that depicts the problem statement that you are trying to solve?
Regards
Goutham
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Yes -- thanks. (I thought that was implied after selecting your post as the solution.)
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Hi,
Thanks for the confirmation!
As this issue has been resolved, we will no longer respond to this thread.
If you require any additional assistance from Intel, please start a new thread.
Any further interaction in this thread will be considered community only.
Thanks & Regards
Goutham
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
A SYCL context contains a collection of devices that the host can use and manages memory objects that can be shared between the devices.
Multiple devices on same platform can share a context, and multiple queues can share same context.
SYCL USM data is accessible on other devices in same context.
auto P = sycl::platform p(sycl::gpu_seclector_v);
auto devices = P.get_devices();
auto C = sycl::context(devices);
sycl::queue q0 = new sycl::queue(C, devices[0]);
sycl::queue q1 = new sycl::queue(C, devices[1]);
a = sycl::malloc_device<float>(N, q0);
b = sycl::malloc_device<float>(N, q1);
q0.memcpy(a, host_a, sizeof(float) * N).wait();
q1.memcpy(b, host_b, sizeof(float) * N).wait();
q0.parallel_for(sycl::range{N}, [=](sycl::item<1> i) {
a[i] += b[i]; // buffer b on device 1 is added to buffer a on device 0
});
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable