Skip to content
forked from iree-org/iree
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(CUDA): add new target for testing #30

Merged
merged 1 commit into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/plugins/iree_compiler_plugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ if(IREE_INPUT_TOSA)
endif()

if(IREE_TARGET_BACKEND_CUDA)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/target/CellarCUDA target/CellarCUDA)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/target/CUDA target/CUDA)
endif()

Expand Down
68 changes: 68 additions & 0 deletions compiler/plugins/target/CellarCUDA/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright 2022 The IREE Authors
# Copyright 2025 RooflineAI GmbH
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

load("//build_tools/bazel:build_defs.oss.bzl", "iree_compiler_cc_library", "iree_compiler_register_plugin")

package(
default_visibility = ["//visibility:public"],
features = ["layering_check"],
licenses = ["notice"], # Apache 2.0
)

iree_compiler_register_plugin(
plugin_id = "hal_target_cellar_cuda",
target = ":CellarCUDA",
)

iree_compiler_cc_library(
name = "CellarCUDA",
srcs = [
"CUDATarget.cpp",
],
deps = [
"//compiler/plugins/target/CellarCUDA/CodeGen",
"//compiler/src/iree/compiler/Codegen",
"//compiler/src/iree/compiler/Codegen/Common",
"//compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR:IREECodegenDialect",
"//compiler/src/iree/compiler/Codegen/Dialect/GPU/TargetUtils:KnownTargets",
"//compiler/src/iree/compiler/Codegen/LLVMGPU",
"//compiler/src/iree/compiler/Codegen/Utils",
"//compiler/src/iree/compiler/Dialect/HAL/Target",
"//compiler/src/iree/compiler/Dialect/HAL/Utils:ExecutableDebugInfoUtils",
"//compiler/src/iree/compiler/Dialect/HAL/Utils:LLVMLinkerUtils",
"//compiler/src/iree/compiler/PluginAPI",
"//compiler/src/iree/compiler/Utils",
"//runtime/src/iree/base/internal/flatcc:building",
"//runtime/src/iree/schemas:cuda_executable_def_c_fbs",
"//runtime/src/iree/schemas:executable_debug_info_c_fbs",
"@iree_cuda//:libdevice_embedded",
"@llvm-project//llvm:Analysis",
"@llvm-project//llvm:BitReader",
"@llvm-project//llvm:BitWriter",
"@llvm-project//llvm:Core",
"@llvm-project//llvm:IPO",
"@llvm-project//llvm:Linker",
"@llvm-project//llvm:MC",
"@llvm-project//llvm:NVPTXCodeGen",
"@llvm-project//llvm:NVPTXInfo",
"@llvm-project//llvm:NVPTXUtilsAndDesc",
"@llvm-project//llvm:Passes",
"@llvm-project//llvm:Support",
"@llvm-project//llvm:Target",
"@llvm-project//mlir:BuiltinToLLVMIRTranslation",
"@llvm-project//mlir:GPUDialect",
"@llvm-project//mlir:LLVMDialect",
"@llvm-project//mlir:LLVMToLLVMIRTranslation",
"@llvm-project//mlir:NVGPUDialect",
"@llvm-project//mlir:NVVMDialect",
"@llvm-project//mlir:NVVMToLLVMIRTranslation",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:ToLLVMIRTranslation",
"@llvm-project//mlir:TransformDialect",
],
)
69 changes: 69 additions & 0 deletions compiler/plugins/target/CellarCUDA/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
################################################################################
# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from #
# compiler/plugins/target/CellarCUDA/BUILD.bazel #
# #
# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary #
# CMake-only content. #
# #
# To disable autogeneration for this file entirely, delete this header. #
################################################################################

iree_add_all_subdirs()

iree_compiler_register_plugin(
PLUGIN_ID
hal_target_cellar_cuda
TARGET
::CellarCUDA
)

iree_cc_library(
NAME
CellarCUDA
SRCS
"CUDATarget.cpp"
DEPS
LLVMAnalysis
LLVMBitReader
LLVMBitWriter
LLVMCore
LLVMLinker
LLVMMC
LLVMNVPTXCodeGen
LLVMNVPTXDesc
LLVMNVPTXInfo
LLVMPasses
LLVMSupport
LLVMTarget
LLVMipo
MLIRBuiltinToLLVMIRTranslation
MLIRGPUDialect
MLIRLLVMDialect
MLIRLLVMToLLVMIRTranslation
MLIRNVGPUDialect
MLIRNVVMDialect
MLIRNVVMToLLVMIRTranslation
MLIRPass
MLIRSupport
MLIRTargetLLVMIRExport
MLIRTransformDialect
iree::base::internal::flatcc::building
iree::compiler::Codegen
iree::compiler::Codegen::Common
iree::compiler::Codegen::Dialect::Codegen::IR::IREECodegenDialect
iree::compiler::Codegen::Dialect::GPU::TargetUtils::KnownTargets
iree::compiler::Codegen::LLVMGPU
iree::compiler::Codegen::Utils
iree::compiler::Dialect::HAL::Target
iree::compiler::Dialect::HAL::Utils::ExecutableDebugInfoUtils
iree::compiler::Dialect::HAL::Utils::LLVMLinkerUtils
iree::compiler::PluginAPI
iree::compiler::Utils
iree::compiler::plugins::target::CellarCUDA::CodeGen
iree::schemas::cuda_executable_def_c_fbs
iree::schemas::executable_debug_info_c_fbs
iree_cuda::libdevice_embedded
PUBLIC
)

### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
Loading