ECR #333755 - Changes to Utils to build on Windows
[git-p4: depot-paths = "//depot/stg/hsa/drivers/hsa/runtime/": change = 1131149]
[ROCm/ROCR-Runtime commit: 2eab8a72d4]
This commit is contained in:
@@ -16,7 +16,7 @@ double CalcMedian(vector<double> scores)
|
||||
|
||||
double CalcMean(vector<double> scores)
|
||||
{
|
||||
double mean;
|
||||
double mean = 0;
|
||||
size_t size = scores.size();
|
||||
|
||||
for (int i=0; i<size; ++i)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <x86intrin.h>
|
||||
#include <string.h>
|
||||
#include <cassert>
|
||||
|
||||
@@ -81,6 +80,13 @@ uint32_t HsaRsrcFactory::num_workitems_;
|
||||
uint32_t HsaRsrcFactory::kernel_loop_count_;
|
||||
bool HsaRsrcFactory::print_debug_info_ = false;
|
||||
|
||||
char* HsaRsrcFactory::num_cus_key_ = "num_cus";
|
||||
char* HsaRsrcFactory::brig_path_key_ = "brig_path";
|
||||
char* HsaRsrcFactory::num_waves_key_ = "waves_per_cu";
|
||||
char* HsaRsrcFactory::num_workitems_key_ = "workitems_per_wave";
|
||||
char* HsaRsrcFactory::print_debug_key_ = "print_debug";
|
||||
char* HsaRsrcFactory::kernel_loop_count_key_ = "kernel_loop_count";
|
||||
|
||||
// Constructor of the class
|
||||
HsaRsrcFactory::HsaRsrcFactory( ) {
|
||||
|
||||
@@ -106,7 +112,7 @@ HsaRsrcFactory::~HsaRsrcFactory( ) {
|
||||
// @return uint32_t Number of Gpu agents on platform
|
||||
//
|
||||
uint32_t HsaRsrcFactory::GetCountOfGpuAgents( ) {
|
||||
return gpu_list_.size();
|
||||
return uint32_t(gpu_list_.size());
|
||||
}
|
||||
|
||||
// Get the AgentInfo handle of a Gpu device
|
||||
@@ -120,7 +126,7 @@ uint32_t HsaRsrcFactory::GetCountOfGpuAgents( ) {
|
||||
bool HsaRsrcFactory::GetGpuAgentInfo(uint32_t idx, AgentInfo **agent_info) {
|
||||
|
||||
// Determine if request is valid
|
||||
uint32_t size = gpu_list_.size();
|
||||
uint32_t size = uint32_t(gpu_list_.size());
|
||||
if (idx >= size) {
|
||||
return false;
|
||||
}
|
||||
@@ -238,7 +244,6 @@ bool HsaRsrcFactory::LoadAndFinalize(AgentInfo *agent_info,
|
||||
// Finalize hsail program.
|
||||
hsa_isa_t isa = {0};
|
||||
status = hsa_agent_get_info(agent_info->dev_id, HSA_AGENT_INFO_ISA, &isa);
|
||||
std::cout << "Value of device Isa Id: " << isa.handle << std::endl;
|
||||
check("Error in getting Id of Isa supported by agent", status);
|
||||
|
||||
hsa_ext_control_directives_t control_directives;
|
||||
@@ -326,7 +331,7 @@ void HsaRsrcFactory::AddAgentInfo(AgentInfo *agent_info) {
|
||||
bool HsaRsrcFactory::PrintGpuAgents( ) {
|
||||
|
||||
AgentInfo *agent_info;
|
||||
int size = gpu_list_.size();
|
||||
int size = uint32_t(gpu_list_.size());
|
||||
for (int idx = 0; idx < size; idx++) {
|
||||
agent_info = gpu_list_[idx];
|
||||
std::cout << std::endl;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <x86intrin.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <iostream>
|
||||
@@ -231,32 +230,32 @@ class HsaRsrcFactory {
|
||||
// Records the file path where Brig file is located.
|
||||
// Value is available only after an instance has been built.
|
||||
static char* brig_path_;
|
||||
static constexpr char* brig_path_key_ = "brig_path";
|
||||
static char* brig_path_key_;
|
||||
|
||||
// Records the number of Compute units present on system.
|
||||
// Value is available only after an instance has been built.
|
||||
static uint32_t num_cus_;
|
||||
static constexpr char* num_cus_key_ = "num_cus";
|
||||
static char* num_cus_key_;
|
||||
|
||||
// Records the number of waves that can be launched per Compute unit
|
||||
// Value is available only after an instance has been built.
|
||||
static uint32_t num_waves_;
|
||||
static constexpr char* num_waves_key_ = "waves_per_cu";
|
||||
static char* num_waves_key_;
|
||||
|
||||
// Records the number of work-items that can be packed into a wave
|
||||
// Value is available only after an instance has been built.
|
||||
static uint32_t num_workitems_;
|
||||
static constexpr char* num_workitems_key_ = "workitems_per_wave";
|
||||
static char* num_workitems_key_;
|
||||
|
||||
// Records the number of times kernel loop body should run. Value
|
||||
// is available only after an instance has been built.
|
||||
static uint32_t kernel_loop_count_;
|
||||
static constexpr char* kernel_loop_count_key_ = "kernel_loop_count";
|
||||
static char* kernel_loop_count_key_;
|
||||
|
||||
// Records the number of times kernel loop body should run. Value
|
||||
// is available only after an instance has been built.
|
||||
static bool print_debug_info_;
|
||||
static constexpr char* print_debug_key_ = "print_debug";
|
||||
static char* print_debug_key_;
|
||||
|
||||
// Print the various fields of Hsa Gpu Agents
|
||||
bool PrintGpuAgents( );
|
||||
|
||||
Fai riferimento in un nuovo problema
Block a user