Repository navigation
Thread safety - #1706
Thread safety#1706
Conversation
Access to InteropManager has to go through device manager now.
Access to fft plan cacher singleton has to go through device manager now.
pavanky
left a comment
There was a problem hiding this comment.
I think having file names as fooManager is a bit weird even if their class names are that way (even weirder when their class names are different).
I suggest simplyfing the naming mechanism and keeping the file names simple. For example:
memoryManager.*should just be part ofmemory.*.interopManager.*should just begraphics.*GfxInteropManagershould just beGraphicsManagercublasManager.*should just becublas.*- same with
cufft,cusolverDn,cusolverSn,clfft,clblas.
| mVendorId = "Unkown, probably ARM"; | ||
| cout<< "Unexpected vendor id" <<endl; | ||
| mVendorId = "Unkown"; | ||
| std::cout<< "Unexpected vendor id" << std::endl; |
There was a problem hiding this comment.
Does this need to be printed out ?
There was a problem hiding this comment.
A left over i think, i will remove it.
| bool isDoubleSupported(int device) | ||
| { | ||
| return true; | ||
| return DeviceManager::IS_DOUBLE_SUPPORTED; |
There was a problem hiding this comment.
Just moved all(possible) hard coded constants into single location(static data members of DeviceManager class).
| flag = true; | ||
| } | ||
| return 0; | ||
| } |
There was a problem hiding this comment.
We should probably consider returning number of devices == number of threads.
|
|
||
| friend queue& getQueue(int device); | ||
|
|
||
| CPUInfo getCPUInfo() const; |
There was a problem hiding this comment.
Where else (outside of platform.cpp) is getCPUInfo going to be used?
There was a problem hiding this comment.
Probably nowhere else. But i can't say we wont in future, may be while checking SSE support availability in hardware when specialising CPU kernels for respective hardware.
|
|
||
| IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") | ||
| SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_MWAITXINTRIN_H_INCLUDED -D_FORCE_INLINES") | ||
| ENDIF() |
There was a problem hiding this comment.
Can you check if this is required for gcc 4.x ?
| : handle(0) | ||
| { | ||
| CUSPARSE_CHECK(cusparseCreate(&handle)); | ||
| CUSPARSE_CHECK(cusparseSetStream(handle, cuda::getStream(cuda::getActiveDeviceId()))); |
There was a problem hiding this comment.
May be have a function called getActiveStream() so we don't have to repeatedly do this.
| } | ||
| } | ||
|
|
||
| } |
There was a problem hiding this comment.
Why is this split from memory.cpp ?
There was a problem hiding this comment.
In order to use the memory manager classes for variable declaration in DeviceManager class, i moved the class declaration into hpp file. Also, I thought it would be consistent with other managers being in their own source files already - *Managers.[hpp|cpp].
| } | ||
| }; | ||
|
|
||
| } |
There was a problem hiding this comment.
Why is this split from memory.hpp?
| { | ||
| cusparseHandles[device].reset(new cusparse::cusparseHandle()); | ||
| } | ||
|
|
There was a problem hiding this comment.
Why unique pointers? There's no reason for any of them to be unique pointers.
There was a problem hiding this comment.
I will go through them again. The sections of code that was managing sparse, solve and blas handles was using boost::scoped_ptr earlier, which i replaced with it's std equivalent unique_ptr.
|
|
||
| std::unique_ptr<cusolver::cusolverDnHandle> cusolverHandles[MAX_DEVICES]; | ||
|
|
||
| std::unique_ptr<cusparse::cusparseHandle> cusparseHandles[MAX_DEVICES]; |
There was a problem hiding this comment.
Why are some unique_ptr while others are not?
There was a problem hiding this comment.
In some cases, the respective resource manager class itself uses some information that is initialised during the creation of DeviceManager class which is causing infinite loop. Therefore, for such cases, i am lazily initialising them using unique_ptrs.
Forgot to remove these files in earlier commit
Minimum required CUDA version currently is 7.0, hence the checks are not needed any more.
This abbrievates the lengthy fn call getStream(getActiveDeviceId())
Add a memory manager stress test.
Also, fixes memory leaks in medfilt and morph unit tests
Disable memory management stress test for CPU backend.
|
build arrayfire windows ci |
|
@9prady9 Edit: Fixed it |
|
build arrayfire windows ci |
|
@pavanky I believe canny's narrowing error is still present in this branch. Edit: I will look at the other errors. |
|
@9prady9 can you merge from devel? |
|
build arrayfire windows ci |
|
build arrayfire linux ci |
|
build arrayfire windows ci |
Fixes #907
Fixes #1728
Fixes #1754
ImplementMaking XCode 8.0 the minimum requirement, which hasthread_localalternative for OSX Platformthread_localsupport.