Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F61569588
matrix_mul_cpu.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, May 7, 12:38
Size
555 B
Mime Type
text/x-c++
Expires
Thu, May 9, 12:38 (2 d)
Engine
blob
Format
Raw Data
Handle
17529425
Attached To
R11201 phpc-2021
matrix_mul_cpu.hh
View Options
#include <vector>
#ifndef MATRIX_MUL_CPU_HH
#define MATRIX_MUL_CPU_HH
class
matrix_gpu
;
class
matrix_cpu
{
public
:
matrix_cpu
(
int
n
,
int
m
)
:
n
(
n
),
m
(
m
),
data
(
n
*
m
)
{}
inline
float
&
operator
()(
int
i
,
int
j
)
{
return
data
[
i
*
n
+
j
];
}
inline
const
float
&
operator
()(
int
i
,
int
j
)
const
{
return
data
[
i
*
n
+
j
];
}
int
rows
()
const
{
return
m
;
}
int
cols
()
const
{
return
n
;
}
private
:
int
n
;
int
m
;
std
::
vector
<
float
>
data
;
};
void
matMulCPU
(
matrix_cpu
&
C
,
const
matrix_gpu
&
A
,
const
matrix_gpu
&
B
);
#endif
/* MATRIX_MUL_CPU_HH */
Event Timeline
Log In to Comment