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
jerrrrry
infinicore
Commits
b91cff79
Commit
b91cff79
authored
Feb 24, 2025
by
YdrMaster
Browse files
issue/63/fix: cleanup code
Signed-off-by:
YdrMaster
<
ydrml@hotmail.com
>
parent
6fc49874
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
14 deletions
+11
-14
src/infiniop/devices/cuda/common_cuda.cuh
src/infiniop/devices/cuda/common_cuda.cuh
+10
-11
src/infiniop/ops/matmul/cpu/matmul_cpu.cc
src/infiniop/ops/matmul/cpu/matmul_cpu.cc
+0
-1
src/infiniop/ops/matmul/cuda/matmul_cuda.cu
src/infiniop/ops/matmul/cuda/matmul_cuda.cu
+1
-2
No files found.
src/infiniop/devices/cuda/common_cuda.cuh
View file @
b91cff79
...
...
@@ -47,27 +47,26 @@ struct InfiniopCudaHandle {
int
compute_capability_minor
;
};
template
<
typename
T
>
void
use_cublas
(
std
::
shared_ptr
<
Pool
<
cublasHandle_t
>>
&
cublas_handle_
pool
,
cudaStream_t
stream
,
T
const
&
f
)
{
auto
handle
=
cublas_handle_
pool
->
pop
();
template
<
class
T
>
void
use_cublas
(
std
::
shared_ptr
<
Pool
<
cublasHandle_t
>>
&
pool
,
cudaStream_t
stream
,
T
const
&
f
)
{
auto
handle
=
pool
->
pop
();
if
(
!
handle
)
{
cublasCreate
(
&
(
*
handle
));
}
cublasSetStream
(
*
handle
,
(
cudaStream_t
)
stream
);
cublasSetStream
(
*
handle
,
stream
);
f
(
*
handle
);
cublas_handle_
pool
->
push
(
std
::
move
(
*
handle
));
pool
->
push
(
std
::
move
(
*
handle
));
}
template
<
typename
T
>
cudnnStatus_t
use_cudnn
(
std
::
shared_ptr
<
Pool
<
cudnnHandle_t
>>
cudnn_handle_pool
,
int
device_id
,
cudaStream_t
stream
,
T
const
&
f
)
{
auto
handle
=
cudnn_handle_
pool
->
pop
();
template
<
class
T
>
void
use_cudnn
(
std
::
shared_ptr
<
Pool
<
cudnnHandle_t
>>
&
pool
,
cudaStream_t
stream
,
T
const
&
f
)
{
auto
handle
=
pool
->
pop
();
if
(
!
handle
)
{
cudnnCreate
(
&
(
*
handle
));
}
cudnnSetStream
(
*
handle
,
stream
);
cudnnStatus_t
status
=
f
(
*
handle
);
cudnn_handle_pool
->
push
(
std
::
move
(
*
handle
));
return
status
;
f
(
*
handle
);
pool
->
push
(
std
::
move
(
*
handle
));
}
inline
cudnnDataType_t
getCudnnDtype
(
infiniDtype_t
dt
)
{
...
...
src/infiniop/ops/matmul/cpu/matmul_cpu.cc
View file @
b91cff79
#include "./matmul_cpu.h"
#include "../../../devices/cpu/common_cpu.h"
#include "../../../devices/cpu/cpu_handle.h"
#include <iostream>
namespace
matmul
::
cpu
{
...
...
src/infiniop/ops/matmul/cuda/matmul_cuda.cu
View file @
b91cff79
...
...
@@ -39,7 +39,7 @@ infiniopStatus_t Descriptor::create(
}
template
<
typename
Tdata
>
infiniopStatus_t
calculate
(
void
calculate
(
MatmulInfo
const
&
_info
,
std
::
shared_ptr
<
Pool
<
cublasHandle_t
>>
&
cublas_handle_pool
,
void
*
c
,
...
...
@@ -98,7 +98,6 @@ infiniopStatus_t calculate(
compute_type
,
CUBLAS_GEMM_DEFAULT_TENSOR_OP
);
});
return
INFINIOP_STATUS_SUCCESS
;
}
infiniopStatus_t
Descriptor
::
calculate
(
...
...
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