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
93 lines
3.8 KiB
C++
93 lines
3.8 KiB
C++
/*******************************************************************************
|
|
*
|
|
* MIT License
|
|
*
|
|
* Copyright (C) 2025-2026 Advanced Micro Devices, Inc. All rights reserved.
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
* in the Software without restriction, including without limitation the rights
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
* furnished to do so, subject to the following conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in
|
|
* all copies or substantial portions of the Software.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
* SOFTWARE.
|
|
*
|
|
*******************************************************************************/
|
|
|
|
#pragma once
|
|
#include <stdexcept>
|
|
#include <origami/origami.hpp>
|
|
#include <rocisa/include/enum.hpp>
|
|
#include <origami/simulator/tensilelite/formocast_simulator.hpp>
|
|
|
|
#include <tensilelitehost/export.h>
|
|
|
|
namespace TensileLite
|
|
{
|
|
|
|
inline origami::data_type_t datatypeToAnalyticalDatatype(rocisa::DataType type)
|
|
{
|
|
switch(type)
|
|
{
|
|
case rocisa::DataType::Float:
|
|
return origami::data_type_t::Float;
|
|
case rocisa::DataType::Double:
|
|
return origami::data_type_t::Double;
|
|
case rocisa::DataType::ComplexFloat:
|
|
return origami::data_type_t::ComplexFloat;
|
|
case rocisa::DataType::ComplexDouble:
|
|
return origami::data_type_t::ComplexDouble;
|
|
case rocisa::DataType::Half:
|
|
return origami::data_type_t::Half;
|
|
case rocisa::DataType::Int8x4:
|
|
return origami::data_type_t::Int8x4;
|
|
case rocisa::DataType::Int32:
|
|
return origami::data_type_t::Int32;
|
|
case rocisa::DataType::BFloat16:
|
|
return origami::data_type_t::BFloat16;
|
|
case rocisa::DataType::Int8:
|
|
return origami::data_type_t::Int8;
|
|
case rocisa::DataType::Int64:
|
|
return origami::data_type_t::Int64;
|
|
case rocisa::DataType::XFloat32:
|
|
return origami::data_type_t::XFloat32;
|
|
case rocisa::DataType::Float8_fnuz:
|
|
return origami::data_type_t::Float8_fnuz;
|
|
case rocisa::DataType::BFloat8_fnuz:
|
|
return origami::data_type_t::BFloat8_fnuz;
|
|
case rocisa::DataType::Float8BFloat8_fnuz:
|
|
return origami::data_type_t::Float8BFloat8_fnuz;
|
|
case rocisa::DataType::BFloat8Float8_fnuz:
|
|
return origami::data_type_t::BFloat8Float8_fnuz;
|
|
case rocisa::DataType::Float8:
|
|
return origami::data_type_t::Float8;
|
|
case rocisa::DataType::BFloat8:
|
|
return origami::data_type_t::BFloat8;
|
|
case rocisa::DataType::Float8BFloat8:
|
|
return origami::data_type_t::Float8BFloat8;
|
|
case rocisa::DataType::BFloat8Float8:
|
|
return origami::data_type_t::BFloat8Float8;
|
|
case rocisa::DataType::Float6:
|
|
return origami::data_type_t::Float6;
|
|
case rocisa::DataType::BFloat6:
|
|
return origami::data_type_t::BFloat6;
|
|
case rocisa::DataType::Float4:
|
|
return origami::data_type_t::Float4;
|
|
|
|
default:
|
|
throw std::runtime_error("Unsupported data type: " + std::to_string(static_cast<int>(type)));
|
|
}
|
|
}
|
|
} // namespace TensileLite
|
|
|