"profiler/vscode:/vscode.git/clone" did not exist on "b134b7d6ffa4914e99c90723f4a2858efe376470"
Commit 698a442e authored by Jehandad Khan's avatar Jehandad Khan
Browse files

Cleanup CMakeLists and correct function name

parent c8dca79f
cmake_minimum_required(VERSION 3.15)
project(ck_app)
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(hip REQUIRED PATHS /opt/rocm)
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)
target_link_libraries(myexe PRIVATE composable_kernel::device_operations composable_kernel::host_tensor hip::host)
#
......@@ -28,8 +28,7 @@ enum ConvOutputLayout
NHWK, // 1
};
// Code to check CUDA errors
void check_cuda_error(void)
void check_hip_error(void)
{
hipError_t err = hipGetLastError();
if(err != hipSuccess)
......@@ -42,7 +41,7 @@ std::string getDeviceName(int device)
{
struct hipDeviceProp_t prop;
hipGetDeviceProperties(&prop, device);
check_cuda_error();
check_hip_error();
return std::string(prop.name);
}
......@@ -50,7 +49,7 @@ int getDriver(void)
{
int driver;
hipDriverGetVersion(&driver);
check_cuda_error();
check_hip_error();
return driver;
}
......@@ -153,11 +152,11 @@ void profile_conv_fwd_impl(int do_verification,
float best_gb_per_sec = 0;
int deviceIndex = 0;
hipSetDevice(deviceIndex);
check_cuda_error();
check_hip_error();
hipStream_t stream_id = nullptr;
hipStreamCreate(&stream_id);
check_cuda_error();
check_hip_error();
// profile device Conv instances
for(auto& conv_ptr : conv_ptrs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment