Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2013-11-16 03:17:10 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2013-11-18 11:48:15 +0400
commitc18712e86814d176433cea781fe1e68715c23bd4 (patch)
treea9aa7a0b34940dceb00f290c720f4a2733819f44 /intern/cycles/kernel/kernel_random.h
parent6f67f7c18cf2c6224f3e3d796bf0d83d2f098b2e (diff)
Cycles: change __device and similar qualifiers to ccl_device in kernel code.
This to avoids build conflicts with libc++ on FreeBSD, these __ prefixed values are reserved for compilers. I apologize to anyone who has patches or branches and has to go through the pain of merging this change, it may be easiest to do these same replacements in your code and then apply/merge the patch. Ref T37477.
Diffstat (limited to 'intern/cycles/kernel/kernel_random.h')
-rw-r--r--intern/cycles/kernel/kernel_random.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/intern/cycles/kernel/kernel_random.h b/intern/cycles/kernel/kernel_random.h
index dc977a8780f..69e7b439e1c 100644
--- a/intern/cycles/kernel/kernel_random.h
+++ b/intern/cycles/kernel/kernel_random.h
@@ -30,7 +30,7 @@ typedef uint RNG;
/* High Dimensional Sobol */
/* van der corput radical inverse */
-__device uint van_der_corput(uint bits)
+ccl_device uint van_der_corput(uint bits)
{
bits = (bits << 16) | (bits >> 16);
bits = ((bits & 0x00ff00ff) << 8) | ((bits & 0xff00ff00) >> 8);
@@ -41,7 +41,7 @@ __device uint van_der_corput(uint bits)
}
/* sobol radical inverse */
-__device uint sobol(uint i)
+ccl_device uint sobol(uint i)
{
uint r = 0;
@@ -53,7 +53,7 @@ __device uint sobol(uint i)
}
/* inverse of sobol radical inverse */
-__device uint sobol_inverse(uint i)
+ccl_device uint sobol_inverse(uint i)
{
const uint msb = 1U << 31;
uint r = 0;
@@ -67,7 +67,7 @@ __device uint sobol_inverse(uint i)
/* multidimensional sobol with generator matrices
* dimension 0 and 1 are equal to van_der_corput() and sobol() respectively */
-__device uint sobol_dimension(KernelGlobals *kg, int index, int dimension)
+ccl_device uint sobol_dimension(KernelGlobals *kg, int index, int dimension)
{
uint result = 0;
uint i = index;
@@ -80,7 +80,7 @@ __device uint sobol_dimension(KernelGlobals *kg, int index, int dimension)
}
/* lookup index and x/y coordinate, assumes m is a power of two */
-__device uint sobol_lookup(const uint m, const uint frame, const uint ex, const uint ey, uint *x, uint *y)
+ccl_device uint sobol_lookup(const uint m, const uint frame, const uint ex, const uint ey, uint *x, uint *y)
{
/* shift is constant per frame */
const uint shift = frame << (m << 1);
@@ -100,7 +100,7 @@ __device uint sobol_lookup(const uint m, const uint frame, const uint ex, const
return index;
}
-__device_inline float path_rng_1D(KernelGlobals *kg, RNG *rng, int sample, int num_samples, int dimension)
+ccl_device_inline float path_rng_1D(KernelGlobals *kg, RNG *rng, int sample, int num_samples, int dimension)
{
#ifdef __CMJ__
if(kernel_data.integrator.sampling_pattern == SAMPLING_PATTERN_CMJ) {
@@ -131,7 +131,7 @@ __device_inline float path_rng_1D(KernelGlobals *kg, RNG *rng, int sample, int n
#endif
}
-__device_inline void path_rng_2D(KernelGlobals *kg, RNG *rng, int sample, int num_samples, int dimension, float *fx, float *fy)
+ccl_device_inline void path_rng_2D(KernelGlobals *kg, RNG *rng, int sample, int num_samples, int dimension, float *fx, float *fy)
{
#ifdef __CMJ__
if(kernel_data.integrator.sampling_pattern == SAMPLING_PATTERN_CMJ) {
@@ -148,7 +148,7 @@ __device_inline void path_rng_2D(KernelGlobals *kg, RNG *rng, int sample, int nu
}
}
-__device_inline void path_rng_init(KernelGlobals *kg, __global uint *rng_state, int sample, int num_samples, RNG *rng, int x, int y, float *fx, float *fy)
+ccl_device_inline void path_rng_init(KernelGlobals *kg, ccl_global uint *rng_state, int sample, int num_samples, RNG *rng, int x, int y, float *fx, float *fy)
{
#ifdef __SOBOL_FULL_SCREEN__
uint px, py;
@@ -183,7 +183,7 @@ __device_inline void path_rng_init(KernelGlobals *kg, __global uint *rng_state,
#endif
}
-__device void path_rng_end(KernelGlobals *kg, __global uint *rng_state, RNG rng)
+ccl_device void path_rng_end(KernelGlobals *kg, ccl_global uint *rng_state, RNG rng)
{
/* nothing to do */
}
@@ -192,24 +192,24 @@ __device void path_rng_end(KernelGlobals *kg, __global uint *rng_state, RNG rng)
/* Linear Congruential Generator */
-__device float path_rng(KernelGlobals *kg, RNG& rng, int sample, int dimension)
+ccl_device float path_rng(KernelGlobals *kg, RNG& rng, int sample, int dimension)
{
}
-__device_inline float path_rng_1D(KernelGlobals *kg, RNG& rng, int sample, int num_samples, int dimension)
+ccl_device_inline float path_rng_1D(KernelGlobals *kg, RNG& rng, int sample, int num_samples, int dimension)
{
/* implicit mod 2^32 */
rng = (1103515245*(rng) + 12345);
return (float)rng * (1.0f/(float)0xFFFFFFFF);
}
-__device_inline void path_rng_2D(KernelGlobals *kg, RNG& rng, int sample, int num_samples, int dimension, float *fx, float *fy)
+ccl_device_inline void path_rng_2D(KernelGlobals *kg, RNG& rng, int sample, int num_samples, int dimension, float *fx, float *fy)
{
*fx = path_rng_1D(kg, rng, sample, num_samples, dimension);
*fy = path_rng_1D(kg, rng, sample, num_samples, dimension + 1);
}
-__device void path_rng_init(KernelGlobals *kg, __global uint *rng_state, int sample, int num_samples, RNG *rng, int x, int y, float *fx, float *fy)
+ccl_device void path_rng_init(KernelGlobals *kg, ccl_global uint *rng_state, int sample, int num_samples, RNG *rng, int x, int y, float *fx, float *fy)
{
/* load state */
*rng = *rng_state;
@@ -225,7 +225,7 @@ __device void path_rng_init(KernelGlobals *kg, __global uint *rng_state, int sam
}
}
-__device void path_rng_end(KernelGlobals *kg, __global uint *rng_state, RNG rng)
+ccl_device void path_rng_end(KernelGlobals *kg, ccl_global uint *rng_state, RNG rng)
{
/* store state for next sample */
*rng_state = rng;
@@ -233,21 +233,21 @@ __device void path_rng_end(KernelGlobals *kg, __global uint *rng_state, RNG rng)
#endif
-__device uint lcg_step_uint(uint *rng)
+ccl_device uint lcg_step_uint(uint *rng)
{
/* implicit mod 2^32 */
*rng = (1103515245*(*rng) + 12345);
return *rng;
}
-__device float lcg_step_float(uint *rng)
+ccl_device float lcg_step_float(uint *rng)
{
/* implicit mod 2^32 */
*rng = (1103515245*(*rng) + 12345);
return (float)*rng * (1.0f/(float)0xFFFFFFFF);
}
-__device uint lcg_init(uint seed)
+ccl_device uint lcg_init(uint seed)
{
uint rng = seed;
lcg_step_uint(&rng);