I am using the latest oneAPI Base Toolkit in my local machine.I tried running the examples provided as zip inside the onemkl folder.Had some inlclude errors in my VS.So I had to turn on the option to use onemkl in my VS 19 and also had to add the folder containing the "common_for_examples.hpp".Noww VS doesn't show any errors,but takes forever to build my .cpp file.Please look into this and help.Urgent help required.Thanks in advance!!
Hi ziglar,can you please let me know the exact procedure you used to run the onemkl examples?
The nmake method as decribed earlier doesn't seem to work.I tried with cmake and it gives me the following error:
Hi AyushM, I didn't run any of the samples provided but wrote my own as I was trying to compare different ways to multiply matrices and cobbled together bits from multiple sources.
I can probably strip my project down to the bare minimum and upload it over the next few days if that helps
Hi AyushM, I have attached a simple example that runs MKL on GPU that hopefully you can run on your PC using VS (I use VS2019 only for this with 2021.2.0 base kit installed).
I don't think I have stripped anything out that will prevent it from running but just let me know.
I can only vouch for the Release version in this zip file.
My original project used boost::ublas but this should all have been removed also.
Check that the paths for the project settings match your setup.
Thanks a lot mate!!
I should open the project using VS and just build it,nothing else right?
Because I did that and got quite a lot of errors.
I'm pretty new to this stuff so please excuse me for a silly question.
Thanks in advance!
On my machine I can open the project, select Release configuration and build and execute with no issues so maybe you PC configuration is different to mine.
@ziglar, thanks for the confirmation, glad to know that your issue is resolved.
@AyushM , please check the C:\Program Files (x86)\Intel\oneAPI\mkl\2021.2.0\examples directory from the MKL related samples and choose examples_dpcpp.zip for dpcpp related samples and do let us know if you are able to compile and execute the samples.
Hope the provided details will help you to solve your issues.
Hi Abhishek, please excuse my (and others) frustration, but the zip file contains no details on how to run the examples with Visual Studio.
DPCC is integrated into VS2019 so why can't we just get from Intel an example VS project (xxx.sln) that executes MKL code on an integrated GPU?
My CMake is pretty weak so I struggle with CMakeLists.txt based projects.
I would have thought that Intel are very keen to lower the barriers to entry on this and make it easily accessible to all who have an interest no matter their technical skills.
Even trying to run cmake from the command line in a command prompt from which I have executed DPCPP setvars.bat fails miserably.
Hope you can help.
I've already done that but I'm still not able to run it.I get a cmake every time I try to run it.
I've followed the same steps as given in the README.txt present inside the examples_dpcpp folder.
It seems that the TARGET_DOMAIN which you are using is invalid. TARGET_DOMAIN should be any domains listed in the folder.
So try running the same command without using TARGET_DOMAIN or you can also use TARGET_FUNCTIONS="rng/uniform" if you only want to use the specific function(uniform from rng)
We tried running the samples and it's compiling and executing for us without any errors.
Please give it a try with valid options.
You may also try the below set of commands
Hope the above details will help you build and run your samples. Refer to the screenshot for more details.
I've tried to execute the exact same command as mentioned by you.
cmake .. -G "Ninja" -DCMAKE_CXX_COMPILER=dpcpp -DTARGET_DEVICES="gpu" -DTARGET_FUNCTIONS="rng/uniform"
I keep getting the same error.Please refer to the below image.
It seems that there is some problem with your environment. Your CMake has detected the dpcpp.exe but the status is broken, so there might be some problem with the installed dpcpp. So please try once compiling and running any simple samples(using oneapi-cli) with dpcpp and check if it's working or not.
If the other samples are working correctly then there might be some issue with your cmake. In such a case try manually compiling and executing the samples from rng, that will work.
I have already compiled and executed dpcpp samples using my Visual Studio and it works all fine.I guess it won't make a difference if I do it using oneapi-cli than VS.
Also please let me know how exactly do we manually compile and execute the samples.
Yes, you are correct, we just wanted to know whether the dpcpp samples compiles and executes.
And we can see that you are able to compile and execute them. Please follow the below steps and commands to compile and execute the sample (rng/uniform).
> mkdir build && cd build
> dpcpp -I..\common -I..\rng -I"C:\Program Files (x86)\Intel\oneAPI\mkl\latest\include" /W3 /EHsc -Wno-unused-function -fno-sycl-early-optimizations -fsycl-unnamed-lambda -DSYCL_DEVICES_gpu -std:c++14 -c ..\rng\source\uniform.cpp
> dpcpp uniform.obj -o rng-uniform.exe -fsycl-device-code-split=per_kernel
This will execute the sample, hope this will help you to resolve your issue.