File: MultiDeviceModuleInit.cpp

package info (click to toggle)
ospray 3.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 10,040 kB
  • sloc: cpp: 80,569; ansic: 951; sh: 805; makefile: 171; python: 69
file content (40 lines) | stat: -rw-r--r-- 1,063 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

// We don't want an instance of ObjectFactory static table in this library
// so we have to include it with import define so the table will be imported
// from 'ospray' library
#include "common/ObjectFactory.h"

#include "MultiDevice.h"
#include "MultiDeviceLoadBalancer.h"
#include "common/OSPCommon.h"

extern "C" OSPError OSPRAY_DLLEXPORT
#ifdef OSPRAY_TARGET_SYCL
ospray_module_init_multidevice_gpu(
#else
ospray_module_init_multidevice_cpu(
#endif
    int16_t versionMajor, int16_t versionMinor, int16_t /*versionPatch*/)
{
  using namespace ospray;

  auto status = moduleVersionCheck(versionMajor, versionMinor);

  if (status == OSP_NO_ERROR) {
    // Run the ISPC module's initialization function as well to register local
    // types
#ifdef OSPRAY_TARGET_SYCL
    status = ospLoadModule("gpu");
#else
    status = ospLoadModule("cpu");
#endif
  }

  if (status == OSP_NO_ERROR) {
    api::Device::registerType<ospray::api::MultiDevice>("multidevice");
  }

  return status;
}