Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
composable_kernel
Commits
49ceb0fe
Commit
49ceb0fe
authored
Oct 22, 2018
by
Chao Liu
Browse files
initial cuda run
parent
2f2cf35b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
17 deletions
+15
-17
src/include/device_tensor.cuh
src/include/device_tensor.cuh
+12
-14
src/include/direct_convolution.cuh
src/include/direct_convolution.cuh
+3
-3
No files found.
src/include/device_tensor.cuh
View file @
49ceb0fe
...
...
@@ -14,26 +14,24 @@ struct DeviceTensorDescriptor
checkCudaErrors
(
cudaMalloc
(
&
mpLengths
,
data_sz
*
mDim
));
checkCudaErrors
(
cudaMalloc
(
&
mpStrides
,
data_sz
*
mDim
));
checkCudaErrors
(
cudaMemcpy
(
const_cast
<
void
*>
(
static_cast
<
const
void
*>
(
host_desc
.
GetLengths
().
data
())),
mpLengths
,
data_sz
*
mDim
,
cudaMemcpyHostToDevice
));
checkCudaErrors
(
cudaMemcpy
(
const_cast
<
void
*>
(
static_cast
<
const
void
*>
(
host_desc
.
GetStrides
().
data
())),
mpStrides
,
data_sz
*
mDim
,
cudaMemcpyHostToDevice
));
checkCudaErrors
(
cudaMemcpy
(
mpLengths
,
host_desc
.
GetLengths
().
data
(),
data_sz
*
mDim
,
cudaMemcpyHostToDevice
));
checkCudaErrors
(
cudaMemcpy
(
mpStrides
,
host_desc
.
GetStrides
().
data
(),
data_sz
*
mDim
,
cudaMemcpyHostToDevice
));
}
__host__
~
DeviceTensorDescriptor
()
{
checkCudaErrors
(
cudaFree
(
mpLengths
));
checkCudaErrors
(
cudaFree
(
mpStrides
));
#if 0
if(mpLengths != nullptr)
checkCudaErrors(cudaFree(mpLengths));
if(mpStrides != nullptr)
checkCudaErrors(cudaFree(mpStrides));
#endif
}
DataType_t
mDataType
;
unsigned
long
mDim
;
unsigned
long
*
mpLengths
;
unsigned
long
*
mpStrides
;
unsigned
long
*
mpLengths
=
nullptr
;
unsigned
long
*
mpStrides
=
nullptr
;
};
src/include/direct_convolution.cuh
View file @
49ceb0fe
...
...
@@ -3,10 +3,10 @@
template
<
class
TFloat
,
int
NBlockDim
>
__global__
void
direct_convolution
(
DeviceTensorDescriptor
in_desc
,
TFloat
*
const
in
,
TFloat
*
const
p_
in
,
DeviceTensorDescriptor
wei_desc
,
TFloat
*
const
wei
,
TFloat
*
const
p_
wei
,
DeviceTensorDescriptor
out_desc
,
TFloat
*
out
)
TFloat
*
p_
out
)
{
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment