-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJobHandler.cpp
More file actions
45 lines (38 loc) · 929 Bytes
/
JobHandler.cpp
File metadata and controls
45 lines (38 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "JobHandler.h"
void JobHandler::setJobHandlerState(int64_t stage)
{
jobStateValues = (jobStateValues & 0x3FFFFFFFFFFFFFFF) | (stage << 62);
}
void JobHandler::setJobHandlerElements(int64_t elements)
{
jobStateValues = (jobStateValues & 0xFFFFFFFF80000000) | elements;
}
void JobHandler::setJobHandlerTotalElements(int64_t totalElements)
{
jobStateValues = (jobStateValues & 0xC00000007FFFFFFF) | (totalElements
<< 31);
}
void JobHandler::setJobHandlerAll(int64_t num)
{
jobStateValues = num;
}
void JobHandler::addJobHandlerElements()
{
jobStateValues++;
}
int64_t JobHandler::getJobStateValues()
{
return jobStateValues;
}
JobHandler::JobHandler ()
{
alreadyWaited = false;
jobStateValues = 0;
}
JobHandler::~JobHandler()
{
// If JobHandler owns the context, it should delete it to prevent memory leaks
for (auto WarpContext: warpVector){
delete WarpContext;
}
}