mirror of
https://github.com/siemens-mobile-hacks/llvm-c166.git
synced 2026-11-25 21:45:57 +00:00
Add an internal StreamTy wrapper for CUDA/HIP language streams in LLVMOffloadKernel. `cudaStream_t`/`hipStream_t` now point to runtime-owned StreamTy objects instead of raw ol_queue_handle_t values. StreamTy tracks the backing queue, owning device, and stream kind, which lets the runtime manage explicit streams and default streams through shared state. Assisted by GPT-5.5, checked and reviewed manually
38 lines
1.4 KiB
C++
38 lines
1.4 KiB
C++
//===-- OffloadErrors.h - Kernel language offload errors ------------------===//
|
|
//
|
|
// Part of the LLVM Project, 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_OFFLOAD_LANGUAGES_KERNEL_INCLUDE_OFFLOAD_ERRORS_H
|
|
#define LLVM_OFFLOAD_LANGUAGES_KERNEL_INCLUDE_OFFLOAD_ERRORS_H
|
|
|
|
#include "OffloadAPI.h"
|
|
|
|
namespace llvm {
|
|
namespace offload {
|
|
|
|
inline constexpr ol_error_struct_t InvalidKernelError = {
|
|
OL_ERRC_INVALID_NULL_HANDLE, "kernel is not registered"};
|
|
|
|
inline constexpr ol_error_struct_t InvalidDeviceError = {OL_ERRC_INVALID_DEVICE,
|
|
"invalid device"};
|
|
|
|
inline constexpr ol_error_struct_t InvalidArgumentError = {
|
|
OL_ERRC_INVALID_ARGUMENT, "invalid argument"};
|
|
|
|
inline constexpr ol_error_struct_t InvalidConfigurationError = {
|
|
OL_ERRC_INVALID_SIZE, "invalid kernel launch configuration"};
|
|
|
|
inline constexpr ol_error_struct_t InvalidNullPointerError = {
|
|
OL_ERRC_INVALID_NULL_POINTER, "invalid null pointer"};
|
|
|
|
inline constexpr ol_error_struct_t InvalidStreamError = {OL_ERRC_INVALID_QUEUE,
|
|
"invalid stream"};
|
|
|
|
} // namespace offload
|
|
} // namespace llvm
|
|
|
|
#endif // LLVM_OFFLOAD_LANGUAGES_KERNEL_INCLUDE_OFFLOAD_ERRORS_H
|