Loading src/TNL/Devices/CMakeLists.txt +0 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,6 @@ set (headers Cuda.h SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/TNL/Devices ) set( common_SOURCES ${CURRENT_DIR}/MIC.cpp ${CURRENT_DIR}/SystemInfo.cpp ) IF( BUILD_CUDA ) Loading src/TNL/Devices/MIC.cppdeleted 100644 → 0 +0 −41 Original line number Diff line number Diff line /*************************************************************************** MIC.cpp - description ------------------- begin : Feb 10, 2017 copyright : (C) 2017 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /* See Copyright Notice in tnl/Copyright */ // Implemented by: Vit Hanousek #include <TNL/Devices/MIC.h> namespace TNL { namespace Devices { SmartPointersRegister MIC::smartPointersRegister; Timer MIC::smartPointersSynchronizationTimer; void MIC::insertSmartPointer( SmartPointer* pointer ) { smartPointersRegister.insert( pointer, -1 ); } void MIC::removeSmartPointer( SmartPointer* pointer ) { smartPointersRegister.remove( pointer, -1 ); } bool MIC::synchronizeDevice( int deviceId ) { smartPointersSynchronizationTimer.start(); bool b = smartPointersRegister.synchronizeDevice( deviceId ); smartPointersSynchronizationTimer.stop(); return b; } } // namespace Devices } // namespace TNL No newline at end of file src/TNL/Devices/MIC.h +43 −32 Original line number Diff line number Diff line Loading @@ -24,8 +24,8 @@ namespace TNL { namespace Devices { namespace { //useful macros from Intel's tutorials -- but we do not use it, becaouse it is tricky (system of maping variables CPU-MIC) #define ALLOC alloc_if(1) //alloac variable at begining of offloaded block -- default Loading Loading @@ -156,24 +156,35 @@ class MIC #endif static void insertSmartPointer( SmartPointer* pointer ); static void insertSmartPointer( SmartPointer* pointer ) { smartPointersRegister.insert( pointer, -1 ); } static void removeSmartPointer( SmartPointer* pointer ); static void removeSmartPointer( SmartPointer* pointer ) { smartPointersRegister.remove( pointer, -1 ); } // Negative deviceId means that CudaDeviceInfo::getActiveDevice will be // called to get the device ID. static bool synchronizeDevice( int deviceId = -1 ); static bool synchronizeDevice( int deviceId = -1 ) { smartPointersSynchronizationTimer.start(); bool b = smartPointersRegister.synchronizeDevice( deviceId ); smartPointersSynchronizationTimer.stop(); return b; } static Timer smartPointersSynchronizationTimer; protected: static SmartPointersRegister smartPointersRegister; }; }//namespace Devices SmartPointersRegister MIC::smartPointersRegister; Timer MIC::smartPointersSynchronizationTimer; } // namespace <unnamed> } // namespace Devices } // namespace TNL Loading
src/TNL/Devices/CMakeLists.txt +0 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,6 @@ set (headers Cuda.h SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/TNL/Devices ) set( common_SOURCES ${CURRENT_DIR}/MIC.cpp ${CURRENT_DIR}/SystemInfo.cpp ) IF( BUILD_CUDA ) Loading
src/TNL/Devices/MIC.cppdeleted 100644 → 0 +0 −41 Original line number Diff line number Diff line /*************************************************************************** MIC.cpp - description ------------------- begin : Feb 10, 2017 copyright : (C) 2017 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /* See Copyright Notice in tnl/Copyright */ // Implemented by: Vit Hanousek #include <TNL/Devices/MIC.h> namespace TNL { namespace Devices { SmartPointersRegister MIC::smartPointersRegister; Timer MIC::smartPointersSynchronizationTimer; void MIC::insertSmartPointer( SmartPointer* pointer ) { smartPointersRegister.insert( pointer, -1 ); } void MIC::removeSmartPointer( SmartPointer* pointer ) { smartPointersRegister.remove( pointer, -1 ); } bool MIC::synchronizeDevice( int deviceId ) { smartPointersSynchronizationTimer.start(); bool b = smartPointersRegister.synchronizeDevice( deviceId ); smartPointersSynchronizationTimer.stop(); return b; } } // namespace Devices } // namespace TNL No newline at end of file
src/TNL/Devices/MIC.h +43 −32 Original line number Diff line number Diff line Loading @@ -24,8 +24,8 @@ namespace TNL { namespace Devices { namespace { //useful macros from Intel's tutorials -- but we do not use it, becaouse it is tricky (system of maping variables CPU-MIC) #define ALLOC alloc_if(1) //alloac variable at begining of offloaded block -- default Loading Loading @@ -156,24 +156,35 @@ class MIC #endif static void insertSmartPointer( SmartPointer* pointer ); static void insertSmartPointer( SmartPointer* pointer ) { smartPointersRegister.insert( pointer, -1 ); } static void removeSmartPointer( SmartPointer* pointer ); static void removeSmartPointer( SmartPointer* pointer ) { smartPointersRegister.remove( pointer, -1 ); } // Negative deviceId means that CudaDeviceInfo::getActiveDevice will be // called to get the device ID. static bool synchronizeDevice( int deviceId = -1 ); static bool synchronizeDevice( int deviceId = -1 ) { smartPointersSynchronizationTimer.start(); bool b = smartPointersRegister.synchronizeDevice( deviceId ); smartPointersSynchronizationTimer.stop(); return b; } static Timer smartPointersSynchronizationTimer; protected: static SmartPointersRegister smartPointersRegister; }; }//namespace Devices SmartPointersRegister MIC::smartPointersRegister; Timer MIC::smartPointersSynchronizationTimer; } // namespace <unnamed> } // namespace Devices } // namespace TNL