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
698a442e
Commit
698a442e
authored
Apr 26, 2022
by
Jehandad Khan
Browse files
Cleanup CMakeLists and correct function name
parent
c8dca79f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
18 deletions
+5
-18
test/client_app/CMakeLists.txt
test/client_app/CMakeLists.txt
+0
-12
test/client_app/client_app_impl.hpp
test/client_app/client_app_impl.hpp
+5
-6
No files found.
test/client_app/CMakeLists.txt
View file @
698a442e
cmake_minimum_required
(
VERSION 3.15
)
cmake_minimum_required
(
VERSION 3.15
)
project
(
ck_app
)
project
(
ck_app
)
add_compile_options
(
-std=c++14
)
add_compile_options
(
-std=c++14
)
# add_link_options(--offload-arch=gfx908)
#set(CMAKE_CXX_STANDARD 14)
#set(CMAKE_CXX_STANDARD_REQUIRED True)
find_package
(
composable_kernel 1.0.0 COMPONENTS device_operations host_tensor
)
find_package
(
composable_kernel 1.0.0 COMPONENTS device_operations host_tensor
)
find_package
(
hip REQUIRED PATHS /opt/rocm
)
find_package
(
hip REQUIRED PATHS /opt/rocm
)
message
(
STATUS
"Build with HIP
${
hip_VERSION
}
"
)
message
(
STATUS
"Build with HIP
${
hip_VERSION
}
"
)
# target_flags(HIP_COMPILER_FLAGS hip::device)
# Remove cuda arch flags
#string(REGEX REPLACE --cuda-gpu-arch=[a-z0-9]+ "" HIP_COMPILER_FLAGS "${HIP_COMPILER_FLAGS}")
#string(REGEX REPLACE --offload-arch=[a-z0-9]+ "" HIP_COMPILER_FLAGS "${HIP_COMPILER_FLAGS}")
#string(REPLACE "$<LINK_LANGUAGE:CXX>" "1" HIP_COMPILER_FLAGS "${HIP_COMPILER_FLAGS}")
#string(REPLACE "SHELL:" "" HIP_COMPILER_FLAGS "${HIP_COMPILER_FLAGS}")
add_executable
(
myexe client_app.cpp
)
add_executable
(
myexe client_app.cpp
)
target_link_libraries
(
myexe PRIVATE composable_kernel::device_operations composable_kernel::host_tensor hip::host
)
target_link_libraries
(
myexe PRIVATE composable_kernel::device_operations composable_kernel::host_tensor hip::host
)
#
test/client_app/client_app_impl.hpp
View file @
698a442e
...
@@ -28,8 +28,7 @@ enum ConvOutputLayout
...
@@ -28,8 +28,7 @@ enum ConvOutputLayout
NHWK
,
// 1
NHWK
,
// 1
};
};
// Code to check CUDA errors
void
check_hip_error
(
void
)
void
check_cuda_error
(
void
)
{
{
hipError_t
err
=
hipGetLastError
();
hipError_t
err
=
hipGetLastError
();
if
(
err
!=
hipSuccess
)
if
(
err
!=
hipSuccess
)
...
@@ -42,7 +41,7 @@ std::string getDeviceName(int device)
...
@@ -42,7 +41,7 @@ std::string getDeviceName(int device)
{
{
struct
hipDeviceProp_t
prop
;
struct
hipDeviceProp_t
prop
;
hipGetDeviceProperties
(
&
prop
,
device
);
hipGetDeviceProperties
(
&
prop
,
device
);
check_
cuda
_error
();
check_
hip
_error
();
return
std
::
string
(
prop
.
name
);
return
std
::
string
(
prop
.
name
);
}
}
...
@@ -50,7 +49,7 @@ int getDriver(void)
...
@@ -50,7 +49,7 @@ int getDriver(void)
{
{
int
driver
;
int
driver
;
hipDriverGetVersion
(
&
driver
);
hipDriverGetVersion
(
&
driver
);
check_
cuda
_error
();
check_
hip
_error
();
return
driver
;
return
driver
;
}
}
...
@@ -153,11 +152,11 @@ void profile_conv_fwd_impl(int do_verification,
...
@@ -153,11 +152,11 @@ void profile_conv_fwd_impl(int do_verification,
float
best_gb_per_sec
=
0
;
float
best_gb_per_sec
=
0
;
int
deviceIndex
=
0
;
int
deviceIndex
=
0
;
hipSetDevice
(
deviceIndex
);
hipSetDevice
(
deviceIndex
);
check_
cuda
_error
();
check_
hip
_error
();
hipStream_t
stream_id
=
nullptr
;
hipStream_t
stream_id
=
nullptr
;
hipStreamCreate
(
&
stream_id
);
hipStreamCreate
(
&
stream_id
);
check_
cuda
_error
();
check_
hip
_error
();
// profile device Conv instances
// profile device Conv instances
for
(
auto
&
conv_ptr
:
conv_ptrs
)
for
(
auto
&
conv_ptr
:
conv_ptrs
)
...
...
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