mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Remove CPP_ATTRIBUTE_FALLTHROUGH macro
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
257b1de14e
commit
d34ef3170a
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@ -7,8 +7,6 @@
|
||||
|
||||
#include "level_zero/core/source/image/image_format_desc_helper.h"
|
||||
|
||||
#include "shared/source/utilities/compiler_support.h"
|
||||
|
||||
#include "third_party/opencl_headers/CL/cl_ext_intel.h"
|
||||
|
||||
namespace L0 {
|
||||
@ -40,7 +38,7 @@ cl_channel_type getClChannelDataType(const ze_image_format_t &imgDescription) {
|
||||
return CL_SNORM_INT16;
|
||||
|
||||
return CL_HALF_FLOAT;
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case ZE_IMAGE_FORMAT_LAYOUT_32:
|
||||
case ZE_IMAGE_FORMAT_LAYOUT_32_32:
|
||||
case ZE_IMAGE_FORMAT_LAYOUT_32_32_32_32:
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "shared/source/image/image_surface_state.h"
|
||||
#include "shared/source/memory_manager/allocation_properties.h"
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
#include "shared/source/utilities/compiler_support.h"
|
||||
|
||||
#include "level_zero/core/source/helpers/properties_parser.h"
|
||||
#include "level_zero/core/source/image/image_formats.h"
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
#include "shared/source/helpers/string.h"
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
#include "shared/source/utilities/compiler_support.h"
|
||||
|
||||
#include "opencl/source/cl_device/cl_device.h"
|
||||
#include "opencl/source/cl_device/cl_device_get_cap.inl"
|
||||
@ -164,7 +163,7 @@ Image *Image::create(Context *context,
|
||||
switch (imageDesc->image_type) {
|
||||
case CL_MEM_OBJECT_IMAGE3D:
|
||||
imageDepth = imageDesc->image_depth;
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case CL_MEM_OBJECT_IMAGE2D:
|
||||
case CL_MEM_OBJECT_IMAGE2D_ARRAY:
|
||||
imageHeight = imageDesc->image_height;
|
||||
@ -727,7 +726,7 @@ void Image::calculateHostPtrOffset(size_t *imageOffset, const size_t *origin, co
|
||||
case CL_MEM_OBJECT_IMAGE1D_BUFFER:
|
||||
case CL_MEM_OBJECT_IMAGE2D:
|
||||
DEBUG_BREAK_IF(slicePitch != 0 && slicePitch < computedImageRowPitch * region[1]);
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case CL_MEM_OBJECT_IMAGE2D_ARRAY:
|
||||
case CL_MEM_OBJECT_IMAGE3D:
|
||||
*imageOffset = origin[2] * computedImageSlicePitch + origin[1] * computedImageRowPitch + origin[0] * bytesPerPixel;
|
||||
|
@ -6,7 +6,6 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
#include "shared/source/utilities/compiler_support.h"
|
||||
#include "shared/test/common/helpers/hw_helper_tests.h"
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
|
||||
@ -48,7 +47,7 @@ DG1TEST_F(HwHelperTestDg1, givenDg1AndVariousSteppingsWhenGettingIsWorkaroundReq
|
||||
switch (stepping) {
|
||||
case REVISION_A0:
|
||||
EXPECT_TRUE(hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_B, hardwareInfo));
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
default:
|
||||
EXPECT_FALSE(hwHelper.isWorkaroundRequired(REVISION_B, REVISION_A0, hardwareInfo));
|
||||
EXPECT_FALSE(hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_D, hardwareInfo));
|
||||
|
@ -6,7 +6,6 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
#include "shared/source/utilities/compiler_support.h"
|
||||
#include "shared/test/common/helpers/hw_helper_tests.h"
|
||||
|
||||
using HwHelperTestGen12Lp = HwHelperTest;
|
||||
@ -57,10 +56,10 @@ TGLLPTEST_F(HwHelperTestGen12Lp, givenTgllpAndVariousSteppingsWhenGettingIsWorka
|
||||
switch (stepping) {
|
||||
case REVISION_A0:
|
||||
EXPECT_TRUE(hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_B, hardwareInfo));
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case REVISION_B:
|
||||
EXPECT_TRUE(hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_C, hardwareInfo));
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
default:
|
||||
EXPECT_FALSE(hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_D, hardwareInfo));
|
||||
EXPECT_FALSE(hwHelper.isWorkaroundRequired(REVISION_B, REVISION_A0, hardwareInfo));
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "shared/source/kernel/implicit_args.h"
|
||||
#include "shared/source/memory_manager/graphics_allocation.h"
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
#include "shared/source/utilities/compiler_support.h"
|
||||
|
||||
#include "RelocationInfo.h"
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "shared/source/device_binary_format/elf/elf_decoder.h"
|
||||
#include "shared/source/device_binary_format/elf/elf_encoder.h"
|
||||
#include "shared/source/device_binary_format/elf/ocl_elf.h"
|
||||
#include "shared/source/utilities/compiler_support.h"
|
||||
|
||||
#include <tuple>
|
||||
|
||||
@ -27,9 +26,9 @@ bool isDeviceBinaryFormat<NEO::DeviceBinaryFormat::OclElf>(const ArrayRef<const
|
||||
default:
|
||||
return false;
|
||||
case Elf::ET_OPENCL_EXECUTABLE:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case Elf::ET_OPENCL_LIBRARY:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case Elf::ET_OPENCL_OBJECTS:
|
||||
return true;
|
||||
}
|
||||
@ -66,7 +65,7 @@ SingleDeviceBinary unpackSingleDeviceBinary<NEO::DeviceBinaryFormat::OclElf>(con
|
||||
auto sectionData = elfSectionHeader.data;
|
||||
switch (elfSectionHeader.header->type) {
|
||||
case Elf::SHT_OPENCL_SPIRV:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case Elf::SHT_OPENCL_LLVM_BINARY:
|
||||
ret.intermediateRepresentation = sectionData;
|
||||
break;
|
||||
|
@ -292,21 +292,21 @@ inline void decodeKernelDataParameterToken(const SPatchDataParameterBuffer *toke
|
||||
break;
|
||||
|
||||
case DATA_PARAMETER_NUM_HARDWARE_THREADS:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case DATA_PARAMETER_PRINTF_SURFACE_SIZE:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case DATA_PARAMETER_IMAGE_SRGB_CHANNEL_ORDER:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case DATA_PARAMETER_STAGE_IN_GRID_ORIGIN:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case DATA_PARAMETER_STAGE_IN_GRID_SIZE:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case DATA_PARAMETER_LOCAL_ID:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case DATA_PARAMETER_EXECUTION_MASK:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case DATA_PARAMETER_VME_IMAGE_TYPE:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case DATA_PARAMETER_VME_MB_SKIP_BLOCK_TYPE:
|
||||
// ignored intentionally
|
||||
break;
|
||||
@ -399,15 +399,15 @@ inline bool decodeToken(const SPatchItemHeader *token, KernelFromPatchtokens &ou
|
||||
break;
|
||||
|
||||
case PATCH_TOKEN_SAMPLER_KERNEL_ARGUMENT:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case PATCH_TOKEN_IMAGE_MEMORY_OBJECT_KERNEL_ARGUMENT:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case PATCH_TOKEN_GLOBAL_MEMORY_OBJECT_KERNEL_ARGUMENT:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case PATCH_TOKEN_STATELESS_GLOBAL_MEMORY_OBJECT_KERNEL_ARGUMENT:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case PATCH_TOKEN_STATELESS_CONSTANT_MEMORY_OBJECT_KERNEL_ARGUMENT:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case PATCH_TOKEN_STATELESS_DEVICE_QUEUE_KERNEL_ARGUMENT:
|
||||
assignArg(out, token);
|
||||
break;
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "shared/source/device_binary_format/yaml/yaml_parser.h"
|
||||
#include "shared/source/program/kernel_info.h"
|
||||
#include "shared/source/program/program_info.h"
|
||||
#include "shared/source/utilities/compiler_support.h"
|
||||
#include "shared/source/utilities/stackvec.h"
|
||||
|
||||
#include <tuple>
|
||||
@ -637,10 +636,10 @@ bool setVecArgIndicesBasedOnSize(CrossThreadDataOffset (&vec)[Len], size_t vecSi
|
||||
return false;
|
||||
case sizeof(ElSize) * 3:
|
||||
vec[2] = static_cast<CrossThreadDataOffset>(baseOffset + 2 * sizeof(ElSize));
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case sizeof(ElSize) * 2:
|
||||
vec[1] = static_cast<CrossThreadDataOffset>(baseOffset + 1 * sizeof(ElSize));
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case sizeof(ElSize) * 1:
|
||||
vec[0] = static_cast<CrossThreadDataOffset>(baseOffset + 0 * sizeof(ElSize));
|
||||
break;
|
||||
@ -671,9 +670,9 @@ NEO::DecodeError populateArgDescriptor(const NEO::Elf::ZebinKernelMetadata::Type
|
||||
outErrReason.append("DeviceBinaryFormat::Zebin : Invalid size for argument of type " + NEO::Elf::ZebinKernelMetadata::Tags::Kernel::PerThreadPayloadArgument::ArgType::localId.str() + " in context of : " + dst.kernelMetadata.kernelName + ". For simd=" + std::to_string(dst.kernelAttributes.simdSize) + " expected : " + std::to_string(singleChannelBytes) + " or " + std::to_string(singleChannelBytes * 2) + " or " + std::to_string(singleChannelBytes * 3) + ". Got : " + std::to_string(src.size) + " \n");
|
||||
return DecodeError::InvalidBinary;
|
||||
case 1:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case 2:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case 3:
|
||||
dst.kernelAttributes.numLocalIdChannels = static_cast<uint8_t>(tupleSize);
|
||||
break;
|
||||
@ -697,9 +696,9 @@ NEO::DecodeError populateArgDescriptor(const NEO::Elf::ZebinKernelMetadata::Type
|
||||
return DecodeError::InvalidBinary;
|
||||
|
||||
case 1:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case 2:
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case 3:
|
||||
dst.kernelAttributes.numLocalIdChannels = static_cast<uint8_t>(tupleSize);
|
||||
break;
|
||||
|
@ -7,7 +7,6 @@
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/helpers/aligned_memory.h"
|
||||
#include "shared/source/utilities/compiler_support.h"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
@ -38,11 +37,11 @@ class Hash {
|
||||
case 3:
|
||||
value = static_cast<uint32_t>(*reinterpret_cast<const unsigned char *>(data++));
|
||||
value <<= 8;
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case 2:
|
||||
value |= static_cast<uint32_t>(*reinterpret_cast<const unsigned char *>(data++));
|
||||
value <<= 8;
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case 1:
|
||||
value |= static_cast<uint32_t>(*reinterpret_cast<const unsigned char *>(data++));
|
||||
value <<= 8;
|
||||
|
@ -30,7 +30,6 @@
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
#include "shared/source/os_interface/os_context.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/source/utilities/compiler_support.h"
|
||||
#include "shared/source/utilities/stackvec.h"
|
||||
|
||||
#include <algorithm>
|
||||
@ -753,7 +752,7 @@ bool MemoryManager::isCopyRequired(ImageInfo &imgInfo, const void *hostPtr) {
|
||||
switch (imgInfo.imgDesc.imageType) {
|
||||
case ImageType::Image3D:
|
||||
imageDepth = imgInfo.imgDesc.imageDepth;
|
||||
CPP_ATTRIBUTE_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case ImageType::Image2D:
|
||||
case ImageType::Image2DArray:
|
||||
imageHeight = imgInfo.imgDesc.imageHeight;
|
||||
|
@ -9,7 +9,6 @@ set(NEO_CORE_UTILITIES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/api_intercept.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/arrayref.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cpuintrinsics.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compiler_support.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/const_stringref.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cpu_info.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/debug_file_reader.cpp
|
||||
|
@ -1,22 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined __has_cpp_attribute
|
||||
|
||||
#define CPP_ATTRIBUTE_FALLTHROUGH
|
||||
|
||||
#else
|
||||
|
||||
#if !__has_cpp_attribute(fallthrough)
|
||||
#define CPP_ATTRIBUTE_FALLTHROUGH
|
||||
#else
|
||||
#define CPP_ATTRIBUTE_FALLTHROUGH [[fallthrough]]
|
||||
#endif
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user