MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / Validate

Function Validate

test/opt/loop_optimizations/peeling.cpp:31–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29using PeelingTest = PassTest<::testing::Test>;
30
31bool Validate(const std::vector<uint32_t>& bin) {
32 spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2;
33 spv_context spvContext = spvContextCreate(target_env);
34 spv_diagnostic diagnostic = nullptr;
35 spv_const_binary_t binary = {bin.data(), bin.size()};
36 spv_result_t error = spvValidate(spvContext, &binary, &diagnostic);
37 if (error != 0) spvDiagnosticPrint(diagnostic);
38 spvDiagnosticDestroy(diagnostic);
39 spvContextDestroy(spvContext);
40 return error == 0;
41}
42
43void Match(const std::string& checks, IRContext* context) {
44 // Silence unused warnings with !defined(SPIRV_EFFCE)

Callers 1

MatchFunction · 0.70

Calls 7

spvContextCreateFunction · 0.85
spvValidateFunction · 0.85
spvDiagnosticPrintFunction · 0.85
spvDiagnosticDestroyFunction · 0.85
spvContextDestroyFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected