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
62 lines
2.0 KiB
C++
62 lines
2.0 KiB
C++
// Copyright Advanced Micro Devices, Inc., or its affiliates.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
#include <regex>
|
|
#include <string>
|
|
|
|
#include <rocRoller/GPUArchitecture/GPUArchitectureTarget.hpp>
|
|
#include <rocRoller/Utilities/Logging.hpp>
|
|
#include <rocRoller/Utilities/Settings.hpp>
|
|
#include <rocRoller/Utilities/Utils.hpp>
|
|
|
|
namespace rocRoller
|
|
{
|
|
GPUArchitectureTarget GPUArchitectureTarget::fromString(std::string const& archStr,
|
|
int asicRevisionId)
|
|
{
|
|
GPUArchitectureTarget rv;
|
|
|
|
int start = 0;
|
|
size_t end = archStr.find(":");
|
|
std::string arch = archStr.substr(start, end - start);
|
|
|
|
std::regex pattern(R"(rev(\d+))");
|
|
std::smatch revIdMatch;
|
|
if(std::regex_search(arch, revIdMatch, pattern))
|
|
{
|
|
rv.asicRevisionId = std::stoi(revIdMatch[1]);
|
|
arch = arch.substr(0, revIdMatch.position(0));
|
|
}
|
|
else if(arch == "gfx1250")
|
|
{
|
|
if(asicRevisionId == 2)
|
|
{
|
|
int newRevId = Settings::Get(Settings::GFX1250AsicRevisionId);
|
|
Log::warn("Overriding current device asic revision id from {} to {}",
|
|
asicRevisionId,
|
|
newRevId);
|
|
asicRevisionId = newRevId;
|
|
}
|
|
rv.asicRevisionId = asicRevisionId;
|
|
}
|
|
|
|
rv.gfx = rocRoller::fromString<GPUArchitectureGFX>(arch);
|
|
|
|
while(end != std::string::npos)
|
|
{
|
|
start = end + 1;
|
|
end = archStr.find(":", start);
|
|
std::string feature = archStr.substr(start, end - start);
|
|
if(feature == "xnack+")
|
|
{
|
|
rv.features.xnack = true;
|
|
}
|
|
else if(feature == "sramecc+")
|
|
{
|
|
rv.features.sramecc = true;
|
|
}
|
|
}
|
|
return rv;
|
|
}
|
|
}
|