CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
72 lines
1.7 KiB
C++
72 lines
1.7 KiB
C++
/*
|
|
* Copyright © Advanced Micro Devices, Inc., or its affiliates.
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#ifndef __HSA_BASE__
|
|
#define __HSA_BASE__
|
|
|
|
|
|
#include <vector>
|
|
#include "hsa.h"
|
|
#include "hsa_ext_finalize.h"
|
|
#include "hsa_ext_amd.h"
|
|
#include "hsatimer.h"
|
|
#include "utilities.h"
|
|
#include "common.hpp"
|
|
#include "HSAILTool.h"
|
|
|
|
class HSA_UTIL{
|
|
public:
|
|
HSA_UTIL();
|
|
~HSA_UTIL();
|
|
|
|
public:
|
|
void GetHsailNameAndKernelName(char *hail_file_name_full, char *hail_file_name_base, char *kernel_name);
|
|
bool HsaInit();
|
|
void Close();
|
|
double GetKernelTime();
|
|
double GetSetupTime();
|
|
void* AllocateLocalMemory(size_t size) ;
|
|
void* AllocateSysMemory(size_t size);
|
|
bool TransferData(void *dest, void *src, uint length, bool host_to_dev) ;
|
|
|
|
double Run(int dim, int group_x, int group_y, int group_z, int s_size, int grid_x, int grid_y, int grid_z, void* kernel_args, int kernel_args_size);
|
|
|
|
public:
|
|
hsa_status_t err;
|
|
uint32_t queue_size;
|
|
hsa_agent_t device;
|
|
MemRegion mem_region;
|
|
//hsa_region_t kernarg_region;
|
|
// Memory region supporting kernel parameters
|
|
// hsa_region_t coarse_region;
|
|
// Hsail profile supported by agent
|
|
hsa_profile_t profile;
|
|
|
|
char hail_file_name_full[128];
|
|
char hail_file_name_base[128];
|
|
char hsa_kernel_name[128];
|
|
|
|
hsa_queue_t* command_queue;
|
|
HSAIL_ASM::Tool tool;
|
|
hsa_ext_module_t module;
|
|
hsa_ext_program_t hsa_program;
|
|
hsa_executable_t hsaExecutable;
|
|
hsa_executable_symbol_t kernelSymbol;
|
|
hsa_code_object_t code_object;
|
|
uint64_t codeHandle;
|
|
hsa_signal_t hsa_signal;
|
|
hsa_kernel_dispatch_packet_t dispatch_packet;
|
|
hsa_region_t hsa_kernarg_region;
|
|
|
|
PerfTimer base_timer;
|
|
int base_kernel_time_idx;
|
|
int base_setup_time_idx;
|
|
};
|
|
|
|
|
|
#endif
|
|
|