The following issues were found

aten/src/ATen/native/vulkan/ops/Padding.cpp
1 issues
syntax error
Error

Line: 57

                api::Command::Pool& command_pool = context->command().pool;
  api::Command::Buffer& command_buffer = command_pool.stream();
  {
    if C10_LIKELY (v_output.has_image() && v_self.has_image()) {
      const struct Block final {
        uvec3 extents;
        uint32_t _;
        uvec4 padding;
      } block{

            

Reported by Cppcheck.

aten/src/ATen/native/vulkan/ops/Mean.cpp
1 issues
syntax error
Error

Line: 58

                api::Command::Pool& command_pool = context->command().pool;
  api::Command::Buffer& command_buffer = command_pool.stream();
  {
    if C10_LIKELY(v_input.has_image()) {
      const struct Block final {
        uvec3 extents;
        int32_t range;
        uvec3 iextents;
      } block {

            

Reported by Cppcheck.

aten/src/ATen/native/vulkan/ops/Factory.cpp
1 issues
syntax error
Error

Line: 47

              
#ifdef USE_VULKAN_API

TORCH_LIBRARY_IMPL(aten, Vulkan, m) {
  m.impl(TORCH_SELECTIVE_NAME("aten::empty.memory_format"), at::native::vulkan::ops::empty_memory_format);
  m.impl(TORCH_SELECTIVE_NAME("aten::empty_strided"), TORCH_FN(at::native::vulkan::ops::empty_strided));
}

#endif /* USE_VULKAN_API */

            

Reported by Cppcheck.

aten/src/ATen/native/vulkan/ops/Clamp.cpp
1 issues
syntax error
Error

Line: 34

                api::Command::Pool& command_pool = context->command().pool;
  api::Command::Buffer& command_buffer = command_pool.stream();
  {
    if C10_LIKELY(v_output.has_image() && v_self.has_image()) {
      const struct Block final {
        uvec3 extents;
        uint32_t _;
        vec2 clamp;
      } block {

            

Reported by Cppcheck.

aten/src/ATen/native/vulkan/ops/Arithmetic.cpp
1 issues
syntax error
Error

Line: 72

                api::Command::Pool& command_pool = context->command().pool;
  api::Command::Buffer& command_buffer = command_pool.stream();
  {
    if C10_LIKELY (v_output.has_image() && v_self.has_image()) {
      const float other_val = alpha_arg
          ? other.to<float>() * alpha_arg->to<float>()
          : other.to<float>();
      const struct Block final {
        uvec3 extents;

            

Reported by Cppcheck.

aten/src/ATen/native/vulkan/api/Shader.cpp
1 issues
strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 93 Column: 11 CWE codes: 126

              
    const shaderc::SpvCompilationResult result = context.CompileGlslToSpv(
        source,
        ::strlen(source),
        shaderc_compute_shader,
        "vulkan_shader.comp",
        options);

    const shaderc_compilation_status status = result.GetCompilationStatus();

            

Reported by FlawFinder.

aten/src/ATen/native/vulkan/api/Common.cpp
1 issues
syntax error
Error

Line: 27

              namespace api {

VK_DELETER_DISPATCHABLE_DEFINE(Instance);
VK_DELETER_DISPATCHABLE_DEFINE(Device);
VK_DELETER_NON_DISPATCHABLE_DEFINE(Semaphore);
VK_DELETER_NON_DISPATCHABLE_DEFINE(Fence);
VK_DELETER_NON_DISPATCHABLE_DEFINE(Buffer);
VK_DELETER_NON_DISPATCHABLE_DEFINE(Image);
VK_DELETER_NON_DISPATCHABLE_DEFINE(Event);

            

Reported by Cppcheck.

aten/src/ATen/native/vulkan/api/Allocator.h
1 issues
printf - If format strings can be influenced by an attacker, they can be exploited
Security

Line: 35 Column: 7 CWE codes: 134
Suggestion: Use a constant for the format specification

              
  #define VMA_DEBUG_LOG(format, ...)  \
    do {                              \
      printf(format, ##__VA_ARGS__);  \
      printf("\n");                   \
    } while (false)
#endif /* DEBUG */

#ifdef __clang__

            

Reported by FlawFinder.

aten/src/ATen/native/vulkan/VulkanRegisterOpContextClass.cpp
1 issues
syntax error
Error

Line: 15

              
using detail::convolution2d::createConv2dClampPrePackOpContext;

TORCH_LIBRARY(vulkan, m) {
  m.class_<Conv2dOpContext>("Conv2dOpContext")
      .def_pickle(
          [](const c10::intrusive_ptr<Conv2dOpContext>& op_context)
              -> SerializationTypeConv2dPrePack { // __getstate__
            return op_context->unpack();

            

Reported by Cppcheck.

aten/src/ATen/native/vulkan/VulkanAten.cpp
1 issues
syntax error
Error

Line: 539

              
#ifndef USE_VULKAN_API

TORCH_LIBRARY_IMPL(aten, Vulkan, m) {
  m.impl("slice.Tensor", TORCH_FN(at::native::vulkan::aten::slice));
  m.impl("view", TORCH_FN(at::native::vulkan::aten::reshape));
  m.impl("select.int", TORCH_FN(at::native::vulkan::aten::select));
  m.impl("transpose.int", TORCH_FN(at::native::vulkan::aten::transpose));
  m.impl("transpose_", at::native::vulkan::aten::transpose_);

            

Reported by Cppcheck.