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
162 lines
6.6 KiB
C++
162 lines
6.6 KiB
C++
// Copyright © Advanced Micro Devices, Inc., or its affiliates.
|
|
// SPDX-License-Identifier: MIT
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <gmock/gmock.h>
|
|
|
|
#define HIPDNN_BACKEND_STATIC_DEFINE
|
|
|
|
#include "hipdnn_backend.h"
|
|
#include <hipdnn_frontend/detail/HipdnnBackendInterface.hpp>
|
|
|
|
// NOLINTBEGIN
|
|
|
|
class Mock_hipdnn_backend : public hipdnn_frontend::detail::IHipdnnBackend
|
|
{
|
|
public:
|
|
MOCK_METHOD(hipdnnStatus_t, create, (hipdnnHandle_t * handle), ());
|
|
MOCK_METHOD(hipdnnStatus_t, destroy, (hipdnnHandle_t handle), ());
|
|
MOCK_METHOD(hipdnnStatus_t, setStream, (hipdnnHandle_t handle, hipStream_t streamId), ());
|
|
MOCK_METHOD(hipdnnStatus_t, getStream, (hipdnnHandle_t handle, hipStream_t* streamId), ());
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
backendCreateDescriptor,
|
|
(hipdnnBackendDescriptorType_t descriptor_type,
|
|
hipdnnBackendDescriptor_t* descriptor),
|
|
());
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
backendDestroyDescriptor,
|
|
(hipdnnBackendDescriptor_t descriptor),
|
|
());
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
backendExecute,
|
|
(hipdnnHandle_t handle,
|
|
hipdnnBackendDescriptor_t execution_plan,
|
|
hipdnnBackendDescriptor_t variant_pack),
|
|
());
|
|
MOCK_METHOD(hipdnnStatus_t, backendFinalize, (hipdnnBackendDescriptor_t descriptor), ());
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
backendGetAttribute,
|
|
(hipdnnBackendDescriptor_t descriptor,
|
|
hipdnnBackendAttributeName_t attribute_name,
|
|
hipdnnBackendAttributeType_t attribute_type,
|
|
int64_t requested_element_count,
|
|
int64_t* element_count,
|
|
void* array_of_elements),
|
|
());
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
backendSetAttribute,
|
|
(hipdnnBackendDescriptor_t descriptor,
|
|
hipdnnBackendAttributeName_t attribute_name,
|
|
hipdnnBackendAttributeType_t attribute_type,
|
|
int64_t element_count,
|
|
const void* array_of_elements),
|
|
());
|
|
MOCK_METHOD(const char*, getErrorString, (hipdnnStatus_t status), ());
|
|
MOCK_METHOD(void, getLastErrorString, (char* message, size_t max_size), ());
|
|
MOCK_METHOD(hipdnn_data_sdk::utilities::Version, version, ());
|
|
MOCK_METHOD(const char*, versionString, ());
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
backendCreateAndDeserializeGraphExt,
|
|
(hipdnnBackendDescriptor_t * descriptor,
|
|
const uint8_t* serialized_graph,
|
|
size_t graph_byte_size),
|
|
());
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
backendGetSerializedBinaryGraphExt,
|
|
(hipdnnBackendDescriptor_t descriptor,
|
|
size_t requestedByteSize,
|
|
size_t* graphByteSize,
|
|
uint8_t* serializedGraph),
|
|
(override));
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
backendGetSerializedJsonGraphExt,
|
|
(hipdnnBackendDescriptor_t descriptor,
|
|
size_t requestedByteSize,
|
|
size_t* graphByteSize,
|
|
char* serializedJsonGraph),
|
|
(override));
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
backendCreateAndDeserializeJsonGraphExt,
|
|
(hipdnnBackendDescriptor_t * descriptor,
|
|
const char* jsonGraph,
|
|
size_t jsonByteSize),
|
|
(override));
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
backendGetSerializedExecutionPlanExt,
|
|
(hipdnnBackendDescriptor_t descriptor,
|
|
size_t requestedByteSize,
|
|
size_t* planByteSize,
|
|
uint8_t* serializedPlan),
|
|
(override));
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
backendCreateAndDeserializeExecutionPlanExt,
|
|
(hipdnnHandle_t handle,
|
|
hipdnnBackendDescriptor_t* descriptor,
|
|
const uint8_t* serializedPlan,
|
|
size_t planByteSize),
|
|
(override));
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
backendGetSerializedBinaryGraphAndPlanExt,
|
|
(hipdnnBackendDescriptor_t graphDescriptor,
|
|
hipdnnBackendDescriptor_t executionPlanDescriptor,
|
|
size_t requestedByteSize,
|
|
size_t* blobByteSize,
|
|
uint8_t* serializedBlob),
|
|
(override));
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
backendGetSerializedBinaryContentsExt,
|
|
(const uint8_t* serializedBlob, size_t blobByteSize, int* contentFlags),
|
|
(override));
|
|
MOCK_METHOD(void, loggingCallbackExt, (hipdnnSeverity_t severity, const char* msg), ());
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
setEnginePluginPathsExt,
|
|
(size_t num_paths,
|
|
const char* const* plugin_paths,
|
|
hipdnnPluginLoadingMode_ext_t mode),
|
|
(override));
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
setHeuristicPluginPathsExt,
|
|
(size_t num_paths,
|
|
const char* const* plugin_paths,
|
|
hipdnnPluginLoadingMode_ext_t mode),
|
|
(override));
|
|
MOCK_METHOD(
|
|
hipdnnStatus_t,
|
|
getLoadedEnginePluginPathsExt,
|
|
(hipdnnHandle_t handle, size_t* numPluginPaths, char** pluginPaths, size_t* maxStringLen),
|
|
());
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
getHeuristicPolicyCount,
|
|
(hipdnnHandle_t handle, size_t* numPolicies),
|
|
(override));
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
getHeuristicPolicyInfo,
|
|
(hipdnnHandle_t handle,
|
|
size_t policyIndex,
|
|
int64_t* policyId,
|
|
char* policyName,
|
|
size_t* policyNameLen,
|
|
char* pluginName,
|
|
size_t* pluginNameLen,
|
|
char* pluginVersion,
|
|
size_t* pluginVersionLen,
|
|
char* apiVersion,
|
|
size_t* apiVersionLen),
|
|
(override));
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
setUserLogCallbackExt,
|
|
(hipdnnUserLogCallback_t callback,
|
|
hipdnnSeverity_t minLevel,
|
|
hipdnnLogCallbackMode_t mode,
|
|
hipdnnUserLogCallbackHandle_t userHandle),
|
|
(override));
|
|
MOCK_METHOD(hipdnnStatus_t, backendSetGlobalLogLevelExt, (hipdnnSeverity_t level), (override));
|
|
MOCK_METHOD(hipdnnStatus_t,
|
|
backendGetGlobalLogLevelExt,
|
|
(hipdnnSeverity_t * level),
|
|
(override));
|
|
};
|
|
|
|
// NOLINTEND
|