ATLAS Offline Software
Loading...
Searching...
No Matches
KernelStatus.cxx
Go to the documentation of this file.
1//
2// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3//
4
5// Local include(s).
7
8namespace AthCUDA {
9
11 : m_code( 0 ), m_mutex() {
12
13 m_mutex.lock();
14 }
15
16 void KernelStatus::finished( int code ) {
17
18 m_code = code;
19 m_mutex.unlock();
20 return;
21 }
22
24
25 // Wait for the task to finish.
26 std::lock_guard< std::mutex > lock( m_mutex );
27 // Return the final status code of the kernel.
28 return m_code;;
29 }
30
31} // namespace AthCUDA
int m_code
The result of the kernel execution.
KernelStatus()
Default constructor.
int wait()
Wait for the execution of the kernel to finish.
std::mutex m_mutex
Mutex used for waiting for the CUDA task to finish.
void finished(int code)
Function called by "the framework" when the CUDA kernel finished.
Definition Info.h:14