-
Notifications
You must be signed in to change notification settings - Fork 18
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
Frozen ThreadState Fixes #115
Frozen ThreadState Fixes #115
Conversation
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.
Small comments, overall looks fine to me!
PS: also we need to make sure that CI passes. I think that you were added to approved contributors, so probably CI will be triggered the next time you push without requiring approval?
include/drjit-core/jit.h
Outdated
@@ -495,13 +495,17 @@ extern JIT_EXPORT uint32_t jit_registry_id(const void *ptr); | |||
|
|||
/// Return the largest instance ID for the given domain | |||
/// If the \c domain is \c nullptr, it returns the number of active entries in | |||
/// all domains for the given variant. | |||
/// all domains for the given variant. If the \c variant is empty as well, it |
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.
/// all domains for the given variant. If the \c variant is empty as well, it | |
/// all domains for the given variant. If the \c variant is \c nullptr as well, it |
Need to be precise since ""
and nullptr
are not the same thing.
@@ -495,13 +495,17 @@ extern JIT_EXPORT uint32_t jit_registry_id(const void *ptr); | |||
|
|||
/// Return the largest instance ID for the given domain | |||
/// If the \c domain is \c nullptr, it returns the number of active entries in | |||
/// all domains for the given variant. | |||
/// all domains for the given variant. If the \c variant is empty as well, it | |||
/// traverses all registry entries. | |||
extern JIT_EXPORT uint32_t jit_registry_id_bound(const char *variant, | |||
const char *domain); | |||
|
|||
/// Fills the \c dest pointer array with all pointers registered in the registry. | |||
/// \c dest must point to an array with \c jit_registry_id_bound(variant, nullptr) entries. |
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.
/// \c dest must point to an array with \c jit_registry_id_bound(variant, nullptr) entries. | |
/// \c dest must point to an array with \c jit_registry_id_bound(variant, domain, nullptr) entries. |
include/drjit-core/jit.h
Outdated
extern JIT_EXPORT uint32_t jit_registry_id_bound(const char *variant, | ||
const char *domain); | ||
|
||
/// Fills the \c dest pointer array with all pointers registered in the registry. | ||
/// \c dest must point to an array with \c jit_registry_id_bound(variant, nullptr) entries. | ||
extern JIT_EXPORT void jit_registry_get_pointers(const char *variant, void **dest); | ||
/// If variant is \c nullptr, it traverses all registry entries. |
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.
Specify whether domain
can be nullptr
or not.
extern JIT_EXPORT void jit_registry_get_pointers(const char *variant, void **dest); | ||
/// If variant is \c nullptr, it traverses all registry entries. | ||
extern JIT_EXPORT void jit_registry_get_pointers(const char *variant, | ||
const char *domain_name, |
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.
const char *domain_name, | |
const char *domain, |
For consistency with the other functions.
for (Operation &op : recording->operations){ | ||
if (op.uses_optix){ |
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.
for (Operation &op : recording->operations){ | |
if (op.uses_optix){ | |
for (Operation &op : recording->operations) { | |
if (op.uses_optix) { |
for (Operation &op : recording->operations){ | ||
if (op.uses_optix){ |
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.
Is it possible that op.uses_optix
is true but op.sbt
is nullptr / not fully initialized? (e.g. in the case of some error).
Maybe better to check op.uses_optix && op.sbt
to be safe?
src/registry.cpp
Outdated
@@ -173,12 +173,15 @@ uint32_t jitc_registry_id_bound(const char *variant, const char *domain) { | |||
return r.domains[it->second].id_bound; | |||
} | |||
|
|||
void jitc_registry_get_pointers(const char *variant, void **dest) { | |||
void jitc_registry_get_pointers(const char *variant, const char *domain_name, |
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.
void jitc_registry_get_pointers(const char *variant, const char *domain_name, | |
void jitc_registry_get_pointers(const char *variant, const char *domain, |
src/registry.h
Outdated
@@ -23,13 +23,16 @@ extern uint32_t jitc_registry_id(const void *ptr); | |||
|
|||
/// Return the largest instance ID for the given domain | |||
/// If the \c domain is \c nullptr, it returns the number of active entries in | |||
/// all domains for the given variant. | |||
/// all domains for the given variant. If the \c variant is empty as well, it |
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.
Same comments as in jit.h
for this file.
src/registry.cpp
Outdated
if (variant == nullptr || | ||
(strcmp(domain.variant, variant) == 0 && | ||
(domain_name == nullptr || strcmp(domain.name, domain_name) == 0))) |
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.
This logic might be counter-intuitive, once would probably expect the following:
variant == nullptr & domain == nullptr
: all entriesvariant != nullptr & domain == nullptr
: all entries with this variant (regardless of domain)variant == nullptr & domain != nullptr
: all entries with this domain (regardless of variant)
If you think this is not desired, then the current behavior should be pointed out very explicitly in the docstring.
208dcc9
to
45a455f
Compare
45a455f
to
7f165ed
Compare
This PR is replaced by #121, which changes the source branch. |
This PR adds various fixes to the
Frozen ThreadState
#107 PR, that appeared after merging.capture_call_offset
functionvcall
tests by freeing the copied OptiX SBT and changingborrow
tosteal
in test