Files
TheRock/rocm-systems/projects/clr/rocclr/device/rocm/rocd3d10interop.hpp
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

85 lines
1.9 KiB
C++

/*
* Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#ifndef ROC_D3D10_INTEROP_HPP_
#define ROC_D3D10_INTEROP_HPP_
#include "top.hpp"
#ifdef _WIN32
#include <d3d10.h>
#include <dxgi.h>
namespace amd {
namespace roc {
// Forward declarations
class Device;
class Memory;
namespace D3D10Interop {
/**
* @brief Validate D3D10 device matches ROCr GPU device
*
* Performs validation: LUID matching via DXGI adapter
*
* @param device ROCr device to validate against
* @param d3d10Device D3D10 device to associate
* @param gfxContext Owning amd::Context*, used to cache the DXX extension
* @param validateOnly When true, only check LUID compatibility and skip
* creating/caching the DXX extension objects (used by query paths)
* @return true if devices can interoperate, false otherwise
*/
bool associateD3D10Device(
const Device* device,
ID3D10Device* d3d10Device,
void* gfxContext,
bool validateOnly
);
/**
* @brief Dissociate D3D10 device from ROCr device
*
* Cleanup function called during context destruction
*
* @param device ROCr device
*/
void dissociateD3D10Device(const Device* device, void* const gfxDevice[], void* gfxContext);
/**
* @brief Export D3D10 resource to HSA handle for interop
*
* Extracts shared handle from D3D10 resource and returns it
* as HSA handle for memory mapping
*
* @param memory ROCr memory object
* @param d3d10Obj D3D10 object to export
* @param handle Output HSA handle
* @param offset Output offset into resource
* @return true if export succeeded, false otherwise
*/
bool Export(
const Memory* memory,
D3D10Object* d3d10Obj,
hsa_handle_t* handle,
int* offset,
void* srd,
UINT* srdSize,
hsa_interop_map_flag_t* mapFlags
);
} // namespace D3D10Interop
} // namespace roc
} // namespace amd
#endif // _WIN32
#endif // ROC_D3D10_INTEROP_HPP_