Intel Open VKL Library

Abhishek Nandy
5 min readFeb 24, 2022

Open VKL Library

As a graphics innovator, this is the first article that I am writing on the Open VKL library which is a part of the One API rendering toolkit.

First most we will hear some common words in near future we have to know what are those

<XPU’s> =>[CPUs,GPUs]

We term it as XPU but combined they tell it aims for all CPU’s and GPU’s in Intel architecture.

Intel Xe==> This is the new graphics architecture from Intel

Let’s focus on our topic now its a part of One API rendering toolkit which has many components one of them being the Intel Open Volume Kernel Library.

Open Volume Kernel Library

Open Volume Kernel library is a high-performance library for ray sampling of scenes. Open VKL covers Volume Sampling.

Sampling types in Open VKL

The following figure shows Sampling types in Open VKL

We choose the volume on the nature of the object we are modeling.

C or C++ is the way

One must be thinking about how do we get starting with the Open VKL library so this is the answer. C or C++ is used to get started in terms of programming and developing the pipeline. We can apply multiple operations on these volume types using C or C++ with easy integration. These applications of operations solve common ray tracing traversal problems.

The following figure shows the APIs associated with the operations.

Open VKL is built for performance, leveraging the latest acceleration like AVX512.

Even though some data types are sparse operations are optimized for memory consumption and computing.

Open VKL is open source. It’s available on Intel devcloud.

For anyone who wishes to work on Open VKL here is the link.

Get yourself registered in Intel devcloud, it’s completely free. let’s learn and contribute together.

Getting to know the Lifecycle in C++

Open VKL can be easily accessed by C++. Every app goes through a lifecycle like initialization, creation, consumption, and stopped and here too Open VKL has the same, we will look into it.

Next, we will discuss the lifecycle of an Open VKL app. The next figure shows the entire workflow which we will know in detail elaborately now.

The life cycle goes through steps. These steps are discussed below.

Step1: The include

To get started with Open VKL API in C++ we have to bring in some includes. These include are known as header files.

#include <openvkl/openvkl.h>

If it’s Intels implicit SPMD compiler, the way is different.

Notes:-

What is Intel’s implicit SPMD compiler

It’s a compiler for C language which adds extensions to single programs with multiple data.

The next figure shows how SPMD works.

After discussion on SPMD we discuss the include.

#include <openvkl/openvkl.isph>

Step 2: Device initialization

To get interact with the CPU we need to initialize the CPU device that is done with a help of a module.

vklLoadModule(“cpu_device”);

Step 3:Device instantiation

The next step is to have the device ready for usage that’s why we need to install it.

VKLDevice device = vklNewDevice(“cpu”);

Step 4:Device Creation

By default, the CPU Device selects the maximum SIMD but as we need to segregate the devices we need a special name for it to get it recognized hence we request a specific width using the CPU_4, CPU_8, or CPU_16.

To set the parameters the following call works.

void vklDeviceSetInt(VKLDevice, const char *name, int val);

void vklDeviceSetString(VKLDevice, const char *name, const char *val);

Step 5:Device Commit

The device created needs to be committed before we start using it.

vklCommitDevice(device);

Step 6:Device volume

As the device is ready for use than Open VKL then we need to initialize the objects. To get the device through an object pipeline we need to access volume and data objects that are done via the call VKL New Volume() and VKL New Data()

As we need to release we have to go through the final step.

Step 7:Device Release

When we have utilized everything in Open VKL we need to shut down and release accordingly.

vklReleaseDevice(VKLDevice device);

That’s a wrap of both the articles and it gave an overview of how we get started with Open VKL Library. Thanks for reading…more to come.

About me

I am an award-winning Intel Innovator who has a special inclination to the new graphics architecture that Intel is coming up and also I will be sharing more on other architectures so stay tuned for the space. I am also part of a startup co-founded by two other individuals Kazi and Anubhav and now a 5 million Dollar startup now that started over a coffee at Starbucks. We are working on Voice, Speech AI domain, and here is our website link to visit

My Youtube Channel!! Please subscribe this space will have new videos covering each aspect of Computer architecture, Programming, and other experiments I do.

My work at SIGGRAPH 2018

My papers at IEEE

https://ieeexplore.ieee.org/author/37086930623

--

--

Abhishek Nandy

Chief Data Scientist PrediQt |Intel Certified oneAPI Instructor|Thinker|Innovator