- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
I am new to SYCL and I am trying to execute a very simple code. Here it is:
#include <CL/sycl.hpp>
using namespace sycl;
int main() {
default_selector device_selector;
std::cout << "Device selector has been initialized.\n";
queue q(device_selector);
std::cout << "Queue has been initialized.\n";
return 0;
}
I am using Visual Studio 2019 and I am compilating with Intel oneAPI DPC++ 2022. If I run the code in the Visual Studio Debugger, I obtain:
> Device selector has been initialized.
> Queue has been initialized.
> Sortie de C:\Users\...\Release\test.exe (processus 8516). Code : 0.
> Press any key to continue...
So this is perfectly what I am expecting. But if I run the same .exe in my command prompt, I obtain:
> C:\Users\...\Release>test.exe
> Device selector has been initialized.
>
> C:\Users\...\Release>
It appears that an error occured during the declaration of the queue. But what I get back is nothing, no error, just as if the program ran perfectly.
I have also noticed that during the short time when the program is running in the command prompt (something like one second), I saw that the program Windows Problem Reporting ran in the Task Manager. Than it vanished as soon as the program apparently finished to compute.
I also tried this code:
#include <CL/sycl.hpp>
using namespace sycl;
int main() {
default_selector device_selector;
std::cout << "Device selector has been initialized.\n";
try {
queue q(device_selector);
} catch (...) {
std::cout << "There's an error! Maybe.\n";
}
std::cout << "Queue has been initialized.\n";
return 0;
}
The output was exactly the same.
If someone has a hint or an idea, I would be pleased to read it.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Hi,
Thank you for posting in Intel Communities.
I've tried compiling both the sample codes that you've provided and I am able to get the expected results.
Please refer to the attached screenshots for more information.
Could you please let us know if you're using Intel oneAPI command prompt or System command prompt?
If you wish to execute the code on System command prompt, then please configure the oneAPI environment by following the steps mentioned below.
Go to File Explorer --> C:\Program Files (x86)\intel\oneAPI --> Copy Address --> Open System command prompt and go to this path --> Then enter the command "setvars.bat" to configure your oneAPI environment.
Also, could you please try compiling a sample code on oneAPI CLI and let us know if you're facing the same issue?
Please follow the steps mentioned in the link below to build and run a sample project.
Please do let us know if you are still facing the same issue while compiling the sample code.
Thanks and Regards,
Ditipriya.
Enlace copiado
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Hi,
Thank you for posting in Intel Communities.
I've tried compiling both the sample codes that you've provided and I am able to get the expected results.
Please refer to the attached screenshots for more information.
Could you please let us know if you're using Intel oneAPI command prompt or System command prompt?
If you wish to execute the code on System command prompt, then please configure the oneAPI environment by following the steps mentioned below.
Go to File Explorer --> C:\Program Files (x86)\intel\oneAPI --> Copy Address --> Open System command prompt and go to this path --> Then enter the command "setvars.bat" to configure your oneAPI environment.
Also, could you please try compiling a sample code on oneAPI CLI and let us know if you're facing the same issue?
Please follow the steps mentioned in the link below to build and run a sample project.
Please do let us know if you are still facing the same issue while compiling the sample code.
Thanks and Regards,
Ditipriya.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Hello Ditipriya,
Thanks a lot for your answer. The .exe file was indeed working when I was using the Intel oneAPI command prompt. After using setvars.bat, everything is working perfectly, even in the Windows command prompt.
Have a nice day.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Hi,
Thanks for accepting our solution. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.
Thanks and Regards,
Ditipriya.
- Suscribirse a un feed RSS
- Marcar tema como nuevo
- Marcar tema como leído
- Flotar este Tema para el usuario actual
- Favorito
- Suscribir
- Página de impresión sencilla