Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
Computing framework

VolumeViz uses the Open Inventor Computing Framework to abstract and manage blocks of memory. This topic is explained in detail in Chapter Open Inventor Computing framework. This section will briefly review the computing framework so we can use these classes in example code. There are three main parts of the computing framework: devices, buffers (blocks of data) and algorithms.

Devices

The subclasses of SoDevice allow an application to discover, query and manage the available visualization and computation devices in the system. Open Inventor currently supports four different logical device types. However a single physical device may be accessible as more than one type of logical device. For example, a GPU (graphics board) may be accessible as an OpenGL device, a CUDA device and an OpenCL device.

  • SoCpuDevice : A system CPU, including multiple cores.
  • SoGLDevice : A GPU, managed through the OpenGL API. Using the query methods, you can determine the number of each type of device and specific information about each device such as the total memory. For each device type Open Inventor also provides a class for managing “contexts”, for example SoGLContext. (See Chapter Open Inventor Computing framework for more information.) Note that the word "device" is also used in the Open Inventor API to refer to input devices, but those clases are platform and window system specific, for example SoWinMouse is derived from SoWinDevice.

Buffers

The subclasses of SoBufferObject allow an application to allocate and manage memory on any of the available visualization and computation devices in the system.

  • SoCpuBufferObject : A buffer in CPU system memory.
  • SoGLBufferObject : A buffer in GPU memory managed through the OpenGL API. Memory must be allocated on a specific device. However the abstract SoBufferObject methods allow buffer objects to be used without (necessarily) knowing where the buffer physically exists. For example, the application can pass an SoCpuBufferObject to a getData() method to fetch data into CPU memory. Any buffer object may be “mapped” to a buffer object on a different device. Open Inventor will automatically make the data available on the other device, either by direct association or, if necessary, by copying the data. For example, on the CPU, to access data in a non-CPU buffer, first map the buffer to an SoCpuBufferObject then call the map(AccessMode) method, which returns a reference to the data in the buffer.

Algorithms

In addition to making it easier to integrate your own algorithms, Open Inventor includes optimized implementations of some commonly used algorithms. This means you can use the computing power of the GPU without writing any CUDA or OpenCL code. The CPU algorithm classes are:

  • SoArithmetic : Add, multiply, combine, compute min/max, etc.
  • SoConversion : Convert from one data type to another, e.g. unsigned char to float.
  • SoConvolution : 1D and 2D separable convolution.
  • SoDataExtract : Extract a slice of data from a tile.
  • SoSeismic : Compute Hilbert transform and some basic seismic attributes.