Build and Run Sample Projects Using the Visual Studio* Command Line 您所在的位置:网站首页 mkdir在windows Build and Run Sample Projects Using the Visual Studio* Command Line

Build and Run Sample Projects Using the Visual Studio* Command Line

#Build and Run Sample Projects Using the Visual Studio* Command Line| 来源: 网络整理| 查看: 265

Prerequisite: Configure your system.

To build and run a sample:

Locate a sample project using the Code Sample Browser for Intel® oneAPI Toolkits. Build and run a sample project using CMake*. Download Samples using the Code Sample Browser for Intel® oneAPI Toolkits

Use the Code Sample Browser for Intel oneAPI Toolkits to browse the collection of online Intel® oneAPI samples. You can copy the samples to your local disk as buildable sample projects. Most Intel oneAPI sample projects are built using Make* or CMake, so the build instructions are included as part of the sample in a README file. Code Sample Browser for Intel oneAPI Toolkits is a stand-alone single-file executable that has no dependencies on dynamic runtime libraries.

For a list of components that support CMake, see Use CMake with oneAPI Applications.

IMPORTANT:

An internet connection is required to download the samples for Intel oneAPI Toolkits. For information on how to use this toolkit offline, see Developing in Offline Systems.

Code Sample Browser for Intel oneAPI Toolkits does not work with system proxy settings and does not support WPAD proxy. If you have trouble connecting from behind a proxy, see Troubleshooting.

To download the Intel® oneAPI Rendering Toolkit (Render Kit) samples:

Open an x64 Native Tools Command Prompt for VS 2019 command window. Set up environment variables: call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" NOTE: If you installed the Render Kit to a custom location, make sure to replace C:\Program Files (x86)\Intel\oneAPI\ with the custom installation path before running the command. From the terminal, run the Code Sample Browser for Intel oneAPI Toolkits with C++ and C samples. oneapi-cli -l cpp,c

The oneAPI CLI menu appears:

Select Create a project using arrow keys, then press Enter.

The language selection will appear.

Select the language for your sample. For your first project, select cpp, then press Enter.

The toolkit samples list appears. Render Kit samples are located underneath the oneAPI Libraries subtree.

Navigate to oneAPI Libraries > Getting Started with Intel oneAPI Rendering Toolkit > Intel OSPRay sample > 01_ospray_gsg, then press Enter. Specify a location to download the project to. By default, it is the path from where you ran the Code Sample Browser for Intel oneAPI Toolkits and project name.

Press Tab to select Create, then press Enter. Repeat the steps to download samples for other components: 02_embree_gsg for Intel® Embree, 03_openvkl_gsg for Intel® Open Volume Kernel Library, 04_oidn_gsg for Intel® Open Image Denoise, and 05_ispc_gsg for Intel® Implicit SPMD Program Compiler (Intel® ISPC). The samples are numbered and staged to be tried in order.

Intel Open Volume Kernel Library 03_openvkl_gsg sample is available in the C language menu option of the Code Sample Browser for Intel oneAPI Toolkits:

Select c language:

Select the Intel Open VKL sample:

See Exploring Intel oneAPI Samples from the Command Line for a video tutorial on creating a project with the command line.

Build and Run an Intel® OSPRay Sample using CMake* Navigate to the folder where you downloaded the 01_ospray_gsg sample. Run the following commands to build the sample: mkdir buildcd buildcmake ..cmake --build . --config Release Navigate to the Release directory. Run the application. .\ospTutorialCpp.exe Review the output images with an image viewer application for PPM file type. For example, with ImageMagick*: \imdisplay.exe firstFrameCpp.ppm\imdisplay.exe accumulatedFrameCpp.ppm

You should see the output images:

Single-accumulation render firstFrameCpp:

Ten-accumulation render accumulatedFrameCpp:

Build and Run an Intel® Embree Sample using CMake* Navigate to the folder where you downloaded the 02_embree_gsg sample. Run the following commands to build the sample: mkdir buildcd buildcmake ..cmake --build . --config Release Navigate to the Release directory. Run the application. .\minimal.exe

The sample application performs two ray-to-triangle intersect tests with the Intel Embree API. One test is successful, while the other test is a miss. Output is written to the terminal:

0.000000, 0.000000, -1.000000: Found intersection on geometry 0, primitive 0 at tfar=1.000000 1.000000, 1.000000, -1.000000: Did not find any intersection. Build and Run an Intel® Open Volume Kernel Library Sample using CMake* Navigate to the folder where you downloaded the03_openvkl_gsg sample. Run the following commands to build the sample: mkdir buildcd buildcmake ..cmake --build . --config Release Navigate to the Release directory. Run the application. .\vklTutorial.exe

The sample application shows sampling within a procedurally generated volume and outputs. sampling, gradient computation, and multi-attribute sampling. Output is written to the terminal.

Build and Run an Intel® Open Image Denoise Sample using CMake* Navigate to the folder where you downloaded the 04_oidn_gsg sample. Run the following commands to build the sample: mkdir buildcd buildcmake ..cmake --build . --config Release Navigate to the Release directory. Convert the accumulatedFrameCpp.ppm image to PFM format with LSB data ordering. For example, with the ImageMagick* convert tool: \magick.exe convert \01_ospray_gsg\build\Release\accumulatedFrameCpp.ppm -endian LSB PFM:accumulatedFrameCpp.pfm Run the application to denoise the image. .\oidnDenoise.exe -hdr accumulatedFrameCpp.pfm -o denoised.pfm Review the output image with an image viewer application for PPM file type. For example, with ImageMagick*: \imdisplay.exe denoised.pfm Original ten-accumulation render accumulatedFrameCpp:

Denoised result denoised.pfm:

Build and Run an Intel® Implicit SPMD Program Compiler Sample using CMake* Navigate to the folder where you downloaded the 05_ispc_gsg sample. Run the following commands to build the sample: mkdir buildcd buildcmake ..cmake --build . Run a single-target sample application: .\simple.exe Run a multi-target sample application: ./simple_multi.exe

The application executes a simple floating-point array operation. The result is printed to the stdout.

0: simple(0.000000) = 0.000000 1: simple(1.000000) = 1.000000 2: simple(2.000000) = 4.000000 3: simple(3.000000) = 1.732051 4: simple(4.000000) = 2.000000 5: simple(5.000000) = 2.236068 6: simple(6.000000) = 2.449490 7: simple(7.000000) = 2.645751 8: simple(8.000000) = 2.828427 9: simple(9.000000) = 3.000000 10: simple(10.000000) = 3.162278 11: simple(11.000000) = 3.316625 12: simple(12.000000) = 3.464102 13: simple(13.000000) = 3.605551 14: simple(14.000000) = 3.741657 15: simple(15.000000) = 3.872983 Next Steps

Explore additional resources in Next Steps.



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有