Skip to content

Commit

Permalink
[WIP] rework buffer interface
Browse files Browse the repository at this point in the history
  • Loading branch information
freibold committed Nov 25, 2024
1 parent f3bbc26 commit 219ed60
Show file tree
Hide file tree
Showing 26 changed files with 437 additions and 473 deletions.
9 changes: 8 additions & 1 deletion common/cmake/dpcpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ IF (EMBREE_SYCL_SUPPORT)
SET(CMAKE_CXX_FLAGS_SYCL "${CMAKE_CXX_FLAGS_SYCL} /debug:none") # FIXME: debug information generation takes forever in SYCL
SET(CMAKE_CXX_FLAGS_SYCL "${CMAKE_CXX_FLAGS_SYCL} /DNDEBUG") # FIXME: debug information generation takes forever in SYCL
ELSE()
SET(CMAKE_CXX_FLAGS_SYCL "${CMAKE_CXX_FLAGS_SYCL} -g") # FIXME: debug information generation takes forever in SYCL
message("CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}")
if((CMAKE_BUILD_TYPE STREQUAL "Debug"))
message(STATUS "generate debug information")
SET(CMAKE_CXX_FLAGS_SYCL "${CMAKE_CXX_FLAGS_SYCL} -g") # FIXME: debug information generation takes forever in SYCL
else()
message(STATUS "generate NO debug information")
SET(CMAKE_CXX_FLAGS_SYCL "${CMAKE_CXX_FLAGS_SYCL} -g0") # FIXME: debug information generation takes forever in SYCL
endif()
SET(CMAKE_CXX_FLAGS_SYCL "${CMAKE_CXX_FLAGS_SYCL} -UDEBUG -DNDEBUG") # FIXME: assertion still not working in SYCL
ENDIF()

Expand Down
1 change: 0 additions & 1 deletion common/sys/alloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ namespace embree
void alignedFree(void* ptr)
{
if (ptr) {
printf("call alignedFree %p\n", ptr);
_mm_free(ptr);
}
}
Expand Down
2 changes: 1 addition & 1 deletion common/sys/ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace embree
virtual ~RefCount() {};

virtual RefCount* refInc() { refCounter.fetch_add(1); return this; }
virtual void refDec() { if (refCounter.fetch_add(-1) == 1) { printf("delete ref counted object %p\n", this); delete this; } }
virtual void refDec() { if (refCounter.fetch_add(-1) == 1) delete this; }
private:
std::atomic<size_t> refCounter;
};
Expand Down
13 changes: 13 additions & 0 deletions include/embree4/rtcore_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,22 @@ typedef struct RTCBufferTy* RTCBuffer;
/* Creates a new buffer. */
RTC_API RTCBuffer rtcNewBuffer(RTCDevice device, size_t byteSize);

RTC_API RTCBuffer rtcNewBufferEx(RTCDevice device, size_t byteSize);

/* Creates a new shared buffer. */
RTC_API RTCBuffer rtcNewSharedBuffer(RTCDevice device, void* ptr, size_t byteSize);

/* Creates a new shared buffer. */
RTC_API RTCBuffer rtcNewSharedBufferEx(RTCDevice device, void* ptr, size_t byteSize);

RTC_API void rtcCommitBuffer(RTCBuffer buffer);

#if defined(EMBREE_SYCL_SUPPORT) && defined(SYCL_LANGUAGE_VERSION)

RTC_API void rtcCommitBufferWithQueue(RTCBuffer buffer, sycl::queue queue);

#endif

/* Returns a pointer to the buffer data. */
RTC_API void* rtcGetBufferData(RTCBuffer buffer);

Expand Down
Loading

0 comments on commit 219ed60

Please sign in to comment.