Files
TheRock/rocm-systems/projects/clr/rocclr/device/rocm/rocd3d11interop.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

86 lines
1.9 KiB
C++

/*
* Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#ifndef ROC_D3D11_INTEROP_HPP_
#define ROC_D3D11_INTEROP_HPP_
#include "top.hpp"
#ifdef _WIN32
#include <d3d11.h>
#include <dxgi.h>
namespace amd {
namespace roc {
// Forward declarations
class Device;
class Memory;
namespace D3D11Interop {
/**
* @brief Validate D3D11 device matches ROCr GPU device
*
* Performs validation: LUID matching via DXGI adapter
*
* @param device ROCr device to validate against
* @param d3d11Device D3D11 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 associateD3D11Device(
const Device* device,
ID3D11Device* d3d11Device,
void* gfxContext,
bool validateOnly
);
/**
* @brief Dissociate D3D11 device from ROCr device
*
* Cleanup function called during context destruction
*
* @param device ROCr device
*/
void dissociateD3D11Device(const Device* device, void* const gfxDevice[], void* gfxContext);
/**
* @brief Export D3D11 resource to HSA handle for interop
*
* Extracts shared handle from D3D11 resource and returns it
* as HSA handle for memory mapping
*
* @param memory ROCr memory object
* @param d3d11Obj D3D11 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,
D3D11Object* d3d11Obj,
hsa_handle_t* handle,
int* offset,
void* srd,
UINT* srdSize,
hsa_interop_map_flag_t* mapFlags,
size_t* sizeHint = nullptr
);
} // namespace D3D11Interop
} // namespace roc
} // namespace amd
#endif // _WIN32
#endif // ROC_D3D11_INTEROP_HPP_