ATLAS Offline Software
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 
8 namespace AthCUDA {
9 
11  : m_code( 0 ), m_mutex() {
12 
13  m_mutex.lock();
14  }
15 
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
AthCUDA::KernelStatus::m_code
int m_code
The result of the kernel execution.
Definition: KernelStatus.h:35
KernelStatus.h
AthCUDA::KernelStatus::KernelStatus
KernelStatus()
Default constructor.
Definition: KernelStatus.cxx:10
AthCUDA::KernelStatus::wait
int wait()
Wait for the execution of the kernel to finish.
Definition: KernelStatus.cxx:23
AthCUDA
Definition: Info.h:14
pmontree.code
code
Definition: pmontree.py:443
AthCUDA::KernelStatus::m_mutex
std::mutex m_mutex
Mutex used for waiting for the CUDA task to finish.
Definition: KernelStatus.h:37
AthCUDA::KernelStatus::finished
void finished(int code)
Function called by "the framework" when the CUDA kernel finished.
Definition: KernelStatus.cxx:16