| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
|
||
| void memLock(const void *ptr) { | ||
| memoryManager().userLock(const_cast<void *>(ptr)); | ||
| void memLock(const cl::Buffer *ptr) { |
There was a problem hiding this comment.
what is the road block for having something like the following:
I haven't analyzed all the pros and cons of above approach. was throwing it out there based on the point that hjaving cl_mem everyone in internal API will make it consistent
Sorry, something went wrong.
There was a problem hiding this comment.
I think cl::Buffers are fine internally as long as the native functions are using cl_mem. The mem* functions are used internally and they should be returning cl::Buffers because that is most convenient for our code base. The reason I moved to the nativeAlloc interface is because the memory manager should be compatible with the base OpenCL specification. The C++ interface is not stable enough for that.
Sorry, something went wrong.
| add_test(NAME ${target} COMMAND ${target}) | ||
| endif() | ||
| endforeach() | ||
| endif() |
There was a problem hiding this comment.
What am I missing here ? It feels almost identical to make_test macro.
Sorry, something went wrong.
There was a problem hiding this comment.
cuda_add_executable(${target} cuda.cu)
Sorry, something went wrong.
There was a problem hiding this comment.
Too much redundancy for single line difference :(
Sorry, something went wrong.
|
|
||
| #pragma GCC diagnostic push | ||
| #pragma GCC diagnostic ignored "-Wdeprecated-declarations" | ||
| TEST(Memory, AfAllocDeviceCUDA) { |
There was a problem hiding this comment.
Something like AllocDevicePointerUsability instead of AfAllocDeviceCUDA is more readable name.
Sorry, something went wrong.
There was a problem hiding this comment.
its testing af_alloc_device. I think the name is appropriate here.
Sorry, something went wrong.
| } | ||
|
|
||
| ASSERT_EQ(true, false); // Is there a simple assert statement? | ||
| FAIL(); |
There was a problem hiding this comment.
👍
Sorry, something went wrong.
| // This behavior will change in the future | ||
| ASSERT_EQ(payload->lastNdims, 1); | ||
| ASSERT_EQ(payload->lastDims, af::dim4(aSize * aSize * aSize * aSize)); | ||
| } |
There was a problem hiding this comment.
Tests: E2ETest*D and E2ETest4DComplexDouble can use a better name like MostRecentArrayCreated_*D or ``MostRecentArray_*D`
Sorry, something went wrong.
There was a problem hiding this comment.
Most recent array created is not an appropriate name because it is only one of the many things it tests. in this case we are testing the behavior of the custom memory manager in the case we create a 4D array.
Sorry, something went wrong.
| ASSERT_EQ(payload->lastDims, af::dim4(aSize * aSize * aSize * aSize)); | ||
| } | ||
|
|
||
| TEST_F(MemoryManagerApi, E2ETestMultipleAllocations) { |
There was a problem hiding this comment.
nit: Don't feel like the prefix E2ETest is adding anything to the readability factor..
Sorry, something went wrong.
|
|
||
| #pragma GCC diagnostic push | ||
| #pragma GCC diagnostic ignored "-Wdeprecated-declarations" | ||
| TEST(Memory, AfAllocDeviceCPUC) { |
There was a problem hiding this comment.
AfAllocDeviceCPUC what does C in the end mean ? for this and the following tests
Sorry, something went wrong.
There was a problem hiding this comment.
Uses the C api instead of the C++ api
Sorry, something went wrong.
| #endif | ||
|
|
||
| #pragma GCC diagnostic push | ||
| #pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
There was a problem hiding this comment.
We have to figure out a generic way (a custom drop in marco perhaps) to do this for gcc, clang and msvc if possible. Instead of adding compiler specific pragmas in multiple locations.
Not as a part of this PR, of course.
Sorry, something went wrong.
* Improve documentation of the alloc and free function * Add tests for memory operations
* Older alloc functions were returning cl::Buffer objects. This behavior is deprecated in favor of cl_mem objects on the OpenCL backend
| Back | FazBrowse Home | New Git URL |
The af_alloc_device functions were returning C++ objects instead of C objects. This behavior is now decremented in favor of cl_mem objects in the OpenCL backends. The behavior of the CUDA and CPU backends have not changed.
Updated documentation to clarify proper usage and behavior
Deprecated af_alloc_device af_free_device
Added several memory tests.