-
Notifications
You must be signed in to change notification settings - Fork 383
Add rs_allocate_closure free function. #1944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
59a8ab0
dd273dd
b4a17e2
097f5a7
6b0add9
8332615
00e3d5e
b112bb5
c0f8462
d73a310
aef2a80
ae990c3
da25a77
dd091ca
6cc829b
6060997
b634e3c
8c61327
3c3481d
e51890d
3954a14
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
|
||
#include <OSL/journal.h> | ||
|
||
#include "oslexec_pvt.h" | ||
|
||
// Fallback is to reroute calls back through the virtual function | ||
// based RendererServices from ShaderGlobals. | ||
|
@@ -316,6 +317,18 @@ rs_trace_get(OSL::OpaqueExecContextPtr exec_ctx, OSL::ustringhash name, | |
#endif | ||
} | ||
|
||
OSL_RSOP OSL_HOSTDEVICE void* | ||
rs_allocate_closure(OSL::OpaqueExecContextPtr exec_ctx, size_t size, | ||
size_t alignment) | ||
{ | ||
#ifndef __CUDA_ARCH__ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As this is rs_fallback.cpp, it should never be compiled by CUDA, can we remove the #ifndef CUDA_ARCH There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Everything in rs_fallback is done this way. It is compiled by Cuda, is it not? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Its is not, rs_fallback.cpp only exists in |
||
auto sg = get_sg(exec_ctx); | ||
return sg->context->allocate_closure(size, alignment); | ||
#else | ||
return nullptr; | ||
#endif | ||
} | ||
|
||
OSL_RSOP OSL_HOSTDEVICE void | ||
rs_errorfmt(OSL::OpaqueExecContextPtr exec_ctx, | ||
OSL::ustringhash fmt_specification, int32_t count, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please mention that this can be called from multiple threads and needs to be thread safe, but same applies to all free functions so add to top.