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

Function Validate

test/opt/loop_optimizations/lcssa.cpp:30–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28namespace {
29
30bool Validate(const std::vector<uint32_t>& bin) {
31 spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2;
32 spv_context spvContext = spvContextCreate(target_env);
33 spv_diagnostic diagnostic = nullptr;
34 spv_const_binary_t binary = {bin.data(), bin.size()};
35 spv_result_t error = spvValidate(spvContext, &binary, &diagnostic);
36 if (error != 0) spvDiagnosticPrint(diagnostic);
37 spvDiagnosticDestroy(diagnostic);
38 spvContextDestroy(spvContext);
39 return error == 0;
40}
41
42void Match(const std::string& original, IRContext* context,
43 bool do_validation = true) {

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