-
Notifications
You must be signed in to change notification settings - Fork 5
/
caldgemm_cpu.cpp
134 lines (108 loc) · 3.48 KB
/
caldgemm_cpu.cpp
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/*
* CPU side of CALDGEMM implementation.
*
* Copyright 2015:
* - David Rohr ([email protected])
* - Matthias Bach ([email protected])
* - Matthias Kretz ([email protected])
*
* This file is part of CALDGEMM.
*
* CALDGEMM is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CALDGEMM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CALDGEMM. If not, see <http://www.gnu.org/licenses/>.
*/
#include "caldgemm_cpu.h"
caldgemm_cpu::caldgemm_cpu() : caldgemm()
{
}
caldgemm_cpu::~caldgemm_cpu()
{
}
int caldgemm_cpu::WaitForEvent(int a, int b, int)
{
if (Config->Debug) fprintf(STD_OUT, "\tSkipping waiting for event from device %d obuffer %d...\n", b, a);
return(0);
}
int caldgemm_cpu::Initialize(bool nocalinit)
{
if (!Config->Quiet) fprintf(STD_OUT, "Initializing CALDGEMM (CPU Runtime)\n");
if (Config->Debug) fprintf(STD_OUT, "CALDGEMM_CPU Initialice\n");
nDevices = 0;
gpu_available = 0;
return(0);
}
int caldgemm_cpu::ValidateRuntime()
{
if (Config->Debug) fprintf(STD_OUT, "CALDGEMM_CPU ValidateRuntime\n");
Config->GPU_C = false;
SetDefaultKernelSettings();
return(0);
}
int caldgemm_cpu::CheckDevices()
{
if (Config->Debug) fprintf(STD_OUT, "CALDGEMM_CPU CheckDevices\n");
return(0);
}
int caldgemm_cpu::InitDevices()
{
if (Config->Debug) fprintf(STD_OUT, "CALDGEMM_CPU InitDevices\n");
return(0);
}
int caldgemm_cpu::ReinitDevices()
{
if (Config->Debug) fprintf(STD_OUT, "CALDGEMM_CPU ReinitDevices\n");
return(0);
}
int caldgemm_cpu::InitConstantData(double alpha)
{
if (Config->Debug) fprintf(STD_OUT, "CALDGEMM_CPU InitConstantData\n");
return(0);
}
int caldgemm_cpu::ExecuteKernels(caldgemm::DGEMMPrepareAndExecuteTask& Task, int blockm, int blockn)
{
if (Config->Debug) fprintf(STD_OUT, "CALDGEMM_CPU ExecuteKernels\n");
fprintf(STD_OUT, "Error: DGEMMPrepareAndExecuteTask shoul never be executed for CALDGEMM_CPU\n");
return(1);
}
int caldgemm_cpu::ExitRuntime()
{
if (Config->Debug) fprintf(STD_OUT, "CALDGEMM_CPU ExitRuntime\n");
return(0);
}
int caldgemm_cpu::FetchResult(int device, int j, int m, int n, int mustlock)
{
if (Config->Debug) fprintf(STD_OUT, "CALDGEMM_CPU FetchResult\n");
return(0);
}
int caldgemm_cpu::CheckDMAQueue(int device, int forcej)
{
return(0);
}
int caldgemm_cpu::RunMergeBuffers(double* dst, int device, int j, int width, int height, int gpu_width, int gpu_height, int pitch)
{
if (Config->Debug) fprintf(STD_OUT, "CALDGEMM_CPU RunMergeBuffers\n");
return(0);
}
int caldgemm_cpu::DGEMM_prepare_backend(size_t k, int j, unsigned int num_device, bool prepareM, bool prepareN, bool buffersSufficiant, bool buffersSufficiant0 CALDGEMM_DIVBUFA)
{
if (Config->Debug) fprintf(STD_OUT, "CALDGEMM_CPU DGEMM_prepare k=%lld j=%d device=%d\n", (long long int) k, j, num_device);
return(0);
}
int caldgemm_cpu::ExitDevices()
{
if (Config->Debug) fprintf(STD_OUT, "CALDGEMM_CPU ExitDevices\n");
return(0);
}
int caldgemm_cpu::UseOutputPthreads() {return(0);}
int caldgemm_cpu::UseInputPthreads() {return(0);}
int caldgemm_cpu::UseMutexPerDevice() {return(0);}