Skip to content

Commit 9e138ec

Browse files
committed
remove duplicate symbols from optix build
Signed-off-by: Curtis Black <curtis.w.black@gmail.com>
1 parent 12052f3 commit 9e138ec

File tree

2 files changed

+0
-235
lines changed

2 files changed

+0
-235
lines changed

src/testrender/cuda/rend_lib.cu

Lines changed: 0 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -40,123 +40,6 @@ __direct_callable__dummy_rend_lib()
4040
}
4141

4242

43-
__device__ const void*
44-
osl_add_closure_closure(void* sg_, const void* a_, const void* b_)
45-
{
46-
a_ = __builtin_assume_aligned(a_, alignof(float));
47-
b_ = __builtin_assume_aligned(b_, alignof(float));
48-
OSL_CUDA::ShaderGlobals* sg = (OSL_CUDA::ShaderGlobals*)sg_;
49-
const OSL::ClosureColor* a = (const OSL::ClosureColor*)a_;
50-
const OSL::ClosureColor* b = (const OSL::ClosureColor*)b_;
51-
if (a == NULL)
52-
return b;
53-
if (b == NULL)
54-
return a;
55-
auto* closure_pool = ((RenderState*)sg->renderstate)->closure_pool;
56-
OSL::ClosureAdd* add
57-
= (OSL::ClosureAdd*)closure_pool->allocate(sizeof(OSL::ClosureAdd),
58-
alignof(OSL::ClosureAdd));
59-
if (add) {
60-
add->id = OSL::ClosureColor::ADD;
61-
add->closureA = a;
62-
add->closureB = b;
63-
}
64-
return add;
65-
}
66-
67-
__device__ const void*
68-
osl_mul_closure_color(void* sg_, const void* a_, const void* w_)
69-
{
70-
a_ = __builtin_assume_aligned(a_, alignof(float));
71-
w_ = __builtin_assume_aligned(w_, alignof(float));
72-
73-
OSL_CUDA::ShaderGlobals* sg = (OSL_CUDA::ShaderGlobals*)sg_;
74-
const OSL::ClosureColor* a = (const OSL::ClosureColor*)a_;
75-
const OSL::Color3* w = (const OSL::Color3*)w_;
76-
if (a == NULL)
77-
return NULL;
78-
if (w->x == 0.0f && w->y == 0.0f && w->z == 0.0f)
79-
return NULL;
80-
if (w->x == 1.0f && w->y == 1.0f && w->z == 1.0f)
81-
return a;
82-
auto* closure_pool = ((RenderState*)sg->renderstate)->closure_pool;
83-
OSL::ClosureMul* mul
84-
= (OSL::ClosureMul*)closure_pool->allocate(sizeof(OSL::ClosureMul),
85-
alignof(OSL::ClosureMul));
86-
if (mul) {
87-
mul->id = OSL::ClosureColor::MUL;
88-
mul->weight = *w;
89-
mul->closure = a;
90-
}
91-
return mul;
92-
}
93-
94-
__device__ const void*
95-
osl_mul_closure_float(void* sg_, const void* a_, float w)
96-
{
97-
a_ = __builtin_assume_aligned(a_, alignof(float));
98-
99-
OSL_CUDA::ShaderGlobals* sg = (OSL_CUDA::ShaderGlobals*)sg_;
100-
const OSL::ClosureColor* a = (const OSL::ClosureColor*)a_;
101-
if (a == NULL)
102-
return NULL;
103-
if (w == 0.0f)
104-
return NULL;
105-
if (w == 1.0f)
106-
return a;
107-
auto* closure_pool = ((RenderState*)sg->renderstate)->closure_pool;
108-
OSL::ClosureMul* mul
109-
= (OSL::ClosureMul*)closure_pool->allocate(sizeof(OSL::ClosureMul),
110-
alignof(OSL::ClosureMul));
111-
if (mul) {
112-
mul->id = OSL::ClosureColor::MUL;
113-
mul->weight = OSL::Color3(w);
114-
mul->closure = a;
115-
}
116-
return mul;
117-
}
118-
119-
__device__ void*
120-
osl_allocate_closure_component(void* sg_, int id, int size)
121-
{
122-
OSL_CUDA::ShaderGlobals* sg = (OSL_CUDA::ShaderGlobals*)sg_;
123-
auto* closure_pool = ((RenderState*)sg->renderstate)->closure_pool;
124-
// Allocate the component and the mul back to back
125-
const size_t needed = sizeof(OSL::ClosureComponent) + size;
126-
OSL::ClosureComponent* comp
127-
= (OSL::ClosureComponent*)
128-
closure_pool->allocate(needed, alignof(OSL::ClosureComponent));
129-
if (comp) {
130-
comp->id = id;
131-
comp->w = OSL::Color3(1.0f);
132-
}
133-
return comp;
134-
}
135-
136-
__device__ void*
137-
osl_allocate_weighted_closure_component(void* sg_, int id, int size,
138-
const void* w_)
139-
{
140-
w_ = __builtin_assume_aligned(w_, alignof(float));
141-
142-
OSL_CUDA::ShaderGlobals* sg = (OSL_CUDA::ShaderGlobals*)sg_;
143-
const OSL::Color3* w = (const OSL::Color3*)w_;
144-
if (w->x == 0.0f && w->y == 0.0f && w->z == 0.0f)
145-
return NULL;
146-
auto* closure_pool = ((RenderState*)sg->renderstate)->closure_pool;
147-
// Allocate the component and the mul back to back
148-
const size_t needed = sizeof(OSL::ClosureComponent) + size;
149-
OSL::ClosureComponent* comp
150-
= (OSL::ClosureComponent*)
151-
closure_pool->allocate(needed, alignof(OSL::ClosureComponent));
152-
if (comp) {
153-
comp->id = id;
154-
comp->w = *w;
155-
}
156-
return comp;
157-
}
158-
159-
16043
#define IS_STRING(type) (type.basetype == OSL::TypeDesc::STRING)
16144
#define IS_PTR(type) (type.basetype == OSL::TypeDesc::PTR)
16245
#define IS_COLOR(type) (type.vecsemantics == OSL::TypeDesc::COLOR)

testsuite/example-cuda/rend_lib.cu

Lines changed: 0 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -17,124 +17,6 @@ OSL_NAMESPACE_END
1717
// These functions are declared extern to prevent name mangling.
1818
extern "C" {
1919

20-
21-
__device__ const void*
22-
osl_add_closure_closure(void* sg_, const void* a_, const void* b_)
23-
{
24-
a_ = __builtin_assume_aligned(a_, alignof(float));
25-
b_ = __builtin_assume_aligned(b_, alignof(float));
26-
OSL_CUDA::ShaderGlobals* sg = (OSL_CUDA::ShaderGlobals*)sg_;
27-
const OSL::ClosureColor* a = (const OSL::ClosureColor*)a_;
28-
const OSL::ClosureColor* b = (const OSL::ClosureColor*)b_;
29-
if (a == NULL)
30-
return b;
31-
if (b == NULL)
32-
return a;
33-
auto* closure_pool = ((RenderState*)sg->renderstate)->closure_pool;
34-
OSL::ClosureAdd* add
35-
= (OSL::ClosureAdd*)closure_pool->allocate(sizeof(OSL::ClosureAdd),
36-
alignof(OSL::ClosureAdd));
37-
if (add) {
38-
add->id = OSL::ClosureColor::ADD;
39-
add->closureA = a;
40-
add->closureB = b;
41-
}
42-
return add;
43-
}
44-
45-
__device__ const void*
46-
osl_mul_closure_color(void* sg_, const void* a_, const void* w_)
47-
{
48-
a_ = __builtin_assume_aligned(a_, alignof(float));
49-
w_ = __builtin_assume_aligned(w_, alignof(float));
50-
51-
OSL_CUDA::ShaderGlobals* sg = (OSL_CUDA::ShaderGlobals*)sg_;
52-
const OSL::ClosureColor* a = (const OSL::ClosureColor*)a_;
53-
const OSL::Color3* w = (const OSL::Color3*)w_;
54-
if (a == NULL)
55-
return NULL;
56-
if (w->x == 0.0f && w->y == 0.0f && w->z == 0.0f)
57-
return NULL;
58-
if (w->x == 1.0f && w->y == 1.0f && w->z == 1.0f)
59-
return a;
60-
auto* closure_pool = ((RenderState*)sg->renderstate)->closure_pool;
61-
OSL::ClosureMul* mul
62-
= (OSL::ClosureMul*)closure_pool->allocate(sizeof(OSL::ClosureMul),
63-
alignof(OSL::ClosureMul));
64-
if (mul) {
65-
mul->id = OSL::ClosureColor::MUL;
66-
mul->weight = *w;
67-
mul->closure = a;
68-
}
69-
return mul;
70-
}
71-
72-
__device__ const void*
73-
osl_mul_closure_float(void* sg_, const void* a_, float w)
74-
{
75-
a_ = __builtin_assume_aligned(a_, alignof(float));
76-
77-
OSL_CUDA::ShaderGlobals* sg = (OSL_CUDA::ShaderGlobals*)sg_;
78-
const OSL::ClosureColor* a = (const OSL::ClosureColor*)a_;
79-
if (a == NULL)
80-
return NULL;
81-
if (w == 0.0f)
82-
return NULL;
83-
if (w == 1.0f)
84-
return a;
85-
auto* closure_pool = ((RenderState*)sg->renderstate)->closure_pool;
86-
OSL::ClosureMul* mul
87-
= (OSL::ClosureMul*)closure_pool->allocate(sizeof(OSL::ClosureMul),
88-
alignof(OSL::ClosureMul));
89-
if (mul) {
90-
mul->id = OSL::ClosureColor::MUL;
91-
mul->weight = OSL::Color3(w);
92-
mul->closure = a;
93-
}
94-
return mul;
95-
}
96-
97-
__device__ void*
98-
osl_allocate_closure_component(void* sg_, int id, int size)
99-
{
100-
OSL_CUDA::ShaderGlobals* sg = (OSL_CUDA::ShaderGlobals*)sg_;
101-
auto* closure_pool = ((RenderState*)sg->renderstate)->closure_pool;
102-
// Allocate the component and the mul back to back
103-
const size_t needed = sizeof(OSL::ClosureComponent) + size;
104-
OSL::ClosureComponent* comp
105-
= (OSL::ClosureComponent*)
106-
closure_pool->allocate(needed, alignof(OSL::ClosureComponent));
107-
if (comp) {
108-
comp->id = id;
109-
comp->w = OSL::Color3(1.0f);
110-
}
111-
return comp;
112-
}
113-
114-
__device__ void*
115-
osl_allocate_weighted_closure_component(void* sg_, int id, int size,
116-
const void* w_)
117-
{
118-
w_ = __builtin_assume_aligned(w_, alignof(float));
119-
120-
OSL_CUDA::ShaderGlobals* sg = (OSL_CUDA::ShaderGlobals*)sg_;
121-
const OSL::Color3* w = (const OSL::Color3*)w_;
122-
if (w->x == 0.0f && w->y == 0.0f && w->z == 0.0f)
123-
return NULL;
124-
auto* closure_pool = ((RenderState*)sg->renderstate)->closure_pool;
125-
// Allocate the component and the mul back to back
126-
const size_t needed = sizeof(OSL::ClosureComponent) + size;
127-
OSL::ClosureComponent* comp
128-
= (OSL::ClosureComponent*)
129-
closure_pool->allocate(needed, alignof(OSL::ClosureComponent));
130-
if (comp) {
131-
comp->id = id;
132-
comp->w = *w;
133-
}
134-
return comp;
135-
}
136-
137-
13820
#define IS_STRING(type) (type.basetype == OSL::TypeDesc::STRING)
13921
#define IS_PTR(type) (type.basetype == OSL::TypeDesc::PTR)
14022
#define IS_COLOR(type) (type.vecsemantics == OSL::TypeDesc::COLOR)

0 commit comments

Comments
 (0)