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
80 lines
3.4 KiB
C++
80 lines
3.4 KiB
C++
// Copyright © Advanced Micro Devices, Inc., or its affiliates.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
#pragma once
|
|
|
|
#include "hipdnn_backend.h"
|
|
#include <hipdnn_flatbuffers_sdk/data_objects/graph_generated.h>
|
|
|
|
namespace test_util
|
|
{
|
|
|
|
void createTestHandle(hipdnnHandle_t* handle);
|
|
|
|
void createTestGraph(hipdnnBackendDescriptor_t* descriptor, hipdnnHandle_t handle);
|
|
|
|
void populateTestEngine(hipdnnBackendDescriptor_t engine,
|
|
hipdnnBackendDescriptor_t* graph,
|
|
hipdnnHandle_t handle,
|
|
int64_t gidx,
|
|
bool finalize = false);
|
|
|
|
void createTestEngine(hipdnnBackendDescriptor_t* engine,
|
|
hipdnnBackendDescriptor_t* graph,
|
|
hipdnnHandle_t handle,
|
|
int64_t gidx,
|
|
bool finalize = false);
|
|
|
|
void populateTestEngineConfig(hipdnnBackendDescriptor_t* engineConfig,
|
|
hipdnnBackendDescriptor_t* engine,
|
|
hipdnnBackendDescriptor_t* graph,
|
|
hipdnnHandle_t handle,
|
|
int64_t gidx,
|
|
bool finalize = false);
|
|
|
|
void createTestEngineConfig(hipdnnBackendDescriptor_t* engineConfig,
|
|
hipdnnBackendDescriptor_t* engine,
|
|
hipdnnBackendDescriptor_t* graph,
|
|
hipdnnHandle_t handle,
|
|
int64_t gidx,
|
|
bool finalize = false);
|
|
|
|
void populateTestExecutionPlan(hipdnnBackendDescriptor_t* executionPlan,
|
|
hipdnnBackendDescriptor_t* engineConfig,
|
|
hipdnnBackendDescriptor_t* engine,
|
|
hipdnnBackendDescriptor_t* graph,
|
|
hipdnnHandle_t handle,
|
|
int64_t gidx,
|
|
bool finalize = false);
|
|
|
|
flatbuffers::FlatBufferBuilder createAndPopulateBatchnormNode();
|
|
|
|
void* allocateTensorMemory(const int64_t* dims,
|
|
size_t dimsCount,
|
|
hipdnnBackendAttributeType_t dataType,
|
|
bool initialize);
|
|
|
|
void freeTensorMemory(void* dataPtr);
|
|
|
|
void populateVariantPackWithMappings(hipdnnBackendDescriptor_t variantPack,
|
|
const std::unordered_map<int64_t, void*>& dataPtrMappings,
|
|
void* workspace = nullptr);
|
|
|
|
void createAndInitializeBackendDescriptor(hipdnnBackendDescriptor_t* backendDescriptor,
|
|
const flatbuffers::DetachedBuffer& serializedGraph,
|
|
hipdnnHandle_t handle);
|
|
|
|
void extractTensorInfoFromGraph(const flatbuffers::DetachedBuffer& serializedGraph,
|
|
std::unordered_map<int64_t, std::string>& uidToNameMap,
|
|
std::unordered_map<std::string, int64_t>& nameToUidMap,
|
|
std::unordered_map<int64_t, std::vector<int64_t>>& uidToDimsMap);
|
|
|
|
std::vector<std::string> getLoadedPlugins(hipdnnHandle_t handle);
|
|
|
|
bool isPluginLoaded(const std::vector<std::string>& loadedPlugins, const std::string& pluginName);
|
|
|
|
bool isPluginLoadedByRelativePath(const std::vector<std::string>& loadedPlugins,
|
|
const std::string& relativePath);
|
|
|
|
} // namespace test_util
|