ATLAS Offline Software
Loading...
Searching...
No Matches
Control
AthCUDA
AthCUDAKernel
src
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).
6
#include "
AthCUDAKernel/KernelStatus.h
"
7
8
namespace
AthCUDA
{
9
10
KernelStatus::KernelStatus
()
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
23
int
KernelStatus::wait
() {
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
KernelStatus.h
AthCUDA::KernelStatus::m_code
int m_code
The result of the kernel execution.
Definition
KernelStatus.h:35
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::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
AthCUDA
Definition
Info.h:14
Generated on
for ATLAS Offline Software by
1.14.0