You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The definition of std::free in C++ redirects to the definition of free in C, which says (in Section 7.22.3 of the C11 draft, "Memory management functions"):
A call to free or realloc that deallocates a region p of memory synchronizes with any allocation call that allocates all or part of the region p. This synchronization occurs after any access of p by the deallocating function, and before any such access by the allocating function.
Should this guarantee hold for sycl::free as well?
I cannot immediately see how a developer could detect or rely upon this behavior, but it does seem reasonable to say that sycl::free on a particular memory region always "happens before" any sycl::malloc call that returns the same memory, and that simply accessing the pointer returned by sycl::malloc cannot lead to a race condition.
The text was updated successfully, but these errors were encountered:
Free and Maloc are blocking. And all our API are thread-safe.
SYCL guarantees that all the member functions and special member functions of the SYCL classes described are thread safe.
So I don't understand how any of this can be a problem... But the C people are far smarter than me, so I guess they put it for a reason; so why not copy them : )
Side note for our editor @gmlueck before i forgot. We use both "thread-safe" and "thread safe", I guess we may want to converge to one.
The definition of
std::free
in C++ redirects to the definition offree
in C, which says (in Section 7.22.3 of the C11 draft, "Memory management functions"):Should this guarantee hold for
sycl::free
as well?I cannot immediately see how a developer could detect or rely upon this behavior, but it does seem reasonable to say that
sycl::free
on a particular memory region always "happens before" anysycl::malloc
call that returns the same memory, and that simply accessing the pointer returned bysycl::malloc
cannot lead to a race condition.The text was updated successfully, but these errors were encountered: