rtcNewDevice.3embree3 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. .TH "rtcNewDevice" "3" "" "" "Embree Ray Tracing Kernels 3"
  2. .SS NAME
  3. .IP
  4. .nf
  5. \f[C]
  6. rtcNewDevice\ \-\ creates\ a\ new\ device
  7. \f[]
  8. .fi
  9. .SS SYNOPSIS
  10. .IP
  11. .nf
  12. \f[C]
  13. #include\ <embree3/rtcore.h>
  14. RTCDevice\ rtcNewDevice(const\ char*\ config);
  15. \f[]
  16. .fi
  17. .SS DESCRIPTION
  18. .PP
  19. This function creates a new device and returns a handle to this device.
  20. The device object is reference counted with an initial reference count
  21. of 1.
  22. The handle can be released using the \f[C]rtcReleaseDevice\f[] API call.
  23. .PP
  24. The device object acts as a class factory for all other object types.
  25. All objects created from the device (like scenes, geometries, etc.) hold
  26. a reference to the device, thus the device will not be destroyed unless
  27. these objects are destroyed first.
  28. .PP
  29. Objects are only compatible if they belong to the same device, e.g it is
  30. not allowed to create a geometry in one device and attach it to a scene
  31. created with a different device.
  32. .PP
  33. A configuration string (\f[C]config\f[] argument) can be passed to the
  34. device construction.
  35. This configuration string can be \f[C]NULL\f[] to use the default
  36. configuration.
  37. .PP
  38. When creating the device, Embree reads configurations for the device
  39. from the following locations in order:
  40. .IP "1)" 3
  41. \f[C]config\f[] string passed to the \f[C]rtcNewDevice\f[] function
  42. .IP "2)" 3
  43. \f[C]\&.embree3\f[] file in the application folder
  44. .IP "3)" 3
  45. \f[C]\&.embree3\f[] file in the home folder
  46. .PP
  47. Settings performed later overwrite previous settings.
  48. This way the configuration for the application can be changed globally
  49. (either through the \f[C]rtcNewDevice\f[] call or through the
  50. \f[C]\&.embree3\f[] file in the application folder), and each user has
  51. the option to modify the configuration to fit their needs.
  52. .PP
  53. The following configuration is supported:
  54. .IP \[bu] 2
  55. \f[C]threads=[int]\f[]: Specifies a number of build threads to use.
  56. A value of 0 enables all detected hardware threads.
  57. By default all hardware threads are used.
  58. .IP \[bu] 2
  59. \f[C]set_affinity=[0/1]\f[]: When enabled, build threads are affinitized
  60. to hardware threads.
  61. This option is disabled by default on standard CPUs, and enabled by
  62. default on Xeon Phi Processors.
  63. .IP \[bu] 2
  64. \f[C]start_threads=[0/1]\f[]: When enabled, the build threads are
  65. started upfront.
  66. This can be useful for benchmarking to exclude thread creation time.
  67. This option is disabled by default.
  68. .IP \[bu] 2
  69. \f[C]isa=[sse2,sse4.2,avx,avx2,avx512knl,avx512skx]\f[]: Use specified
  70. ISA.
  71. By default the ISA is selected automatically.
  72. .IP \[bu] 2
  73. \f[C]max_isa=[sse2,sse4.2,avx,avx2,avx512knl,avx512skx]\f[]: Configures
  74. the automated ISA selection to use maximally the specified ISA.
  75. .IP \[bu] 2
  76. \f[C]hugepages=[0/1]\f[]: Enables or disables usage of huge pages.
  77. Under Linux huge pages are used by default but under Windows and macOS
  78. they are disabled by default.
  79. .IP \[bu] 2
  80. \f[C]enable_selockmemoryprivilege=[0/1]\f[]: When set to 1, this enables
  81. the \f[C]SeLockMemoryPrivilege\f[] privilege with is required to use
  82. huge pages on Windows.
  83. This option has an effect only under Windows and is ignored on other
  84. platforms.
  85. See Section [Huge Page Support] for more details.
  86. .IP \[bu] 2
  87. \f[C]ignore_config_files=[0/1]\f[]: When set to 1, configuration files
  88. are ignored.
  89. Default is 0.
  90. .IP \[bu] 2
  91. \f[C]verbose=[0,1,2,3]\f[]: Sets the verbosity of the output.
  92. When set to 0, no output is printed by Embree, when set to a higher
  93. level more output is printed.
  94. By default Embree does not print anything on the console.
  95. .IP \[bu] 2
  96. \f[C]frequency_level=[simd128,simd256,simd512]\f[]: Specifies the
  97. frequency level the application want to run on, which can be either: a)
  98. simd128 for apps that do not use AVX instructions, b) simd256 for apps
  99. that use heavy AVX instruction, c) simd512 for apps that use heavy
  100. AVX\-512 instructions.
  101. When some frequency level is specified, Embree will avoid doing
  102. optimizations that may reduce the frequency level below the level
  103. specified.
  104. E.g.
  105. if your app does not use AVX instructions setting
  106. "frequency_level=simd128" will cause some CPUs to run at highest
  107. frequency, which may result in higher application performance.
  108. However, this will prevent Embree from using AVX optimizations to
  109. achieve higher ray tracing performance, thus applications that trace
  110. many rays may still perform better with the default setting of simd256,
  111. even though this reduces frequency on some CPUs.
  112. .PP
  113. Different configuration options should be separated by commas, e.g.:
  114. .IP
  115. .nf
  116. \f[C]
  117. rtcNewDevice("threads=1,isa=avx");
  118. \f[]
  119. .fi
  120. .SS EXIT STATUS
  121. .PP
  122. On success returns a handle of the created device.
  123. On failure returns \f[C]NULL\f[] as device and sets a per\-thread error
  124. code that can be queried using \f[C]rtcGetDeviceError(NULL)\f[].
  125. .SS SEE ALSO
  126. .PP
  127. [rtcRetainDevice], [rtcReleaseDevice]