Skip to content

Commit

Permalink
Merge pull request #255 from hvdijk/remove-gcc7-workaround
Browse files Browse the repository at this point in the history
Remove GCC 7 workaround.
  • Loading branch information
hvdijk authored Dec 14, 2023
2 parents eab14cd + 58a2394 commit 95718ac
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 102 deletions.
6 changes: 0 additions & 6 deletions modules/cargo/include/cargo/small_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -838,13 +838,7 @@ class small_vector {
}
std::copy(Begin, End, other.Begin);
other.setEnd(other.Begin + size());
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// GCC <9 requires this redundant move, this branch of the #if can be
// deleted once the minimum supported version of GCC is at least 9.
return std::move(other);
#else
return other;
#endif
}

private:
Expand Down
6 changes: 0 additions & 6 deletions modules/compiler/spirv-ll/source/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1125,11 +1125,5 @@ cargo::expected<spirv_ll::Module, spirv_ll::Error> spirv_ll::Context::translate(
return cargo::make_unexpected(llvm::toString(std::move(err)));
}

#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// GCC <9 requires this redundant move, this branch of the #if can be
// deleted once the minimum supported version of GCC is at least 9.
return std::move(module);
#else
return module;
#endif
}
6 changes: 0 additions & 6 deletions source/cl/source/buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,7 @@ cargo::expected<std::unique_ptr<_cl_mem_buffer>, cl_int> _cl_mem_buffer::create(
}
}

#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// GCC <9 requires this redundant move, this branch of the #if can be
// deleted once the minimum supported version of GCC is at least 9.
return std::move(buffer);
#else
return buffer;
#endif
}

cl_int _cl_mem_buffer::synchronize(cl_command_queue command_queue) {
Expand Down
12 changes: 0 additions & 12 deletions source/cl/source/command_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,7 @@ _cl_command_queue::create(cl_context context, cl_device_id device,
OCL_CHECK(nullptr == queue,
return cargo::make_unexpected(CL_OUT_OF_HOST_MEMORY));

#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// GCC <9 requires this redundant move, this branch of the #if can be
// deleted once the minimum supported version of GCC is at least 9.
return std::move(queue);
#else
return queue;
#endif
}

// Used by clCreateCommandQueueWithProperties and
Expand Down Expand Up @@ -194,13 +188,7 @@ _cl_command_queue::create(cl_context context, cl_device_id device,
#endif
}

#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// GCC <9 requires this redundant move, this branch of the #if can be
// deleted once the minimum supported version of GCC is at least 9.
return std::move(command_queue);
#else
return command_queue;
#endif
}

cl_int _cl_command_queue::flush() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,7 @@ cargo::expected<cl_mem_alloc_flags_intel, cl_int> parseProperties(
current += 2;
} while (current[0] != 0);
}
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// GCC <9 requires this redundant move, this branch of the #if can be
// deleted once the minimum supported version of GCC is at least 9.
return std::move(alloc_flags);
#else
return alloc_flags;
#endif
}

allocation_info *findAllocation(const cl_context context, const void *ptr) {
Expand Down Expand Up @@ -252,13 +246,7 @@ host_allocation_info::create(cl_context context,

usm_alloc->alloc_flags = alloc_properties.value();

#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// GCC <9 requires this redundant move, this branch of the #if can be
// deleted once the minimum supported version of GCC is at least 9.
return std::move(usm_alloc);
#else
return usm_alloc;
#endif
}

cl_int host_allocation_info::allocate(cl_uint alignment) {
Expand Down Expand Up @@ -371,13 +359,7 @@ device_allocation_info::create(cl_context context, cl_device_id device,

usm_alloc->alloc_flags = alloc_properties.value();

#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// GCC <9 requires this redundant move, this branch of the #if can be
// deleted once the minimum supported version of GCC is at least 9.
return std::move(usm_alloc);
#else
return usm_alloc;
#endif
}

cl_int device_allocation_info::allocate(cl_uint alignment) {
Expand Down
18 changes: 0 additions & 18 deletions source/cl/source/extension/source/khr_command_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,7 @@ _cl_mutable_command_khr::create(cl_uint id, cl_kernel kernel) {
return cargo::make_unexpected(error);
}

#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// GCC <9 requires this redundant move, this branch of the #if can be
// deleted once the minimum supported version of GCC is at least 9.
return std::move(mutable_command);
#else
return mutable_command;
#endif
}

_cl_command_buffer_khr::_cl_command_buffer_khr(cl_command_queue queue)
Expand Down Expand Up @@ -268,13 +262,7 @@ _cl_command_buffer_khr::create(
}
}

#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// GCC <9 requires this redundant move, this branch of the #if can be
// deleted once the minimum supported version of GCC is at least 9.
return std::move(command_buffer);
#else
return command_buffer;
#endif
}

cl_command_buffer_state_khr _cl_command_buffer_khr::getState() const {
Expand Down Expand Up @@ -340,13 +328,7 @@ _cl_command_buffer_khr::convertWaitList(
return cargo::make_unexpected(CL_OUT_OF_HOST_MEMORY);
}
}
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// GCC <9 requires this redundant move, this branch of the #if can be
// deleted once the minimum supported version of GCC is at least 9.
return std::move(command_wait_list);
#else
return command_wait_list;
#endif
}

cl_int _cl_command_buffer_khr::commandBarrierWithWaitList(
Expand Down
30 changes: 0 additions & 30 deletions source/cl/source/program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,13 +542,7 @@ cargo::expected<std::unique_ptr<_cl_program>, cl_int> _cl_program::create(
context->getCompilerTarget(device));
}
}
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// GCC <9 requires this redundant move, this branch of the #if can be
// deleted once the minimum supported version of GCC is at least 9.
return std::move(program);
#else
return program;
#endif
}

// Used by clCreateProgramWithIL, clCreateProgramWithILKHR.
Expand Down Expand Up @@ -583,13 +577,7 @@ cargo::expected<std::unique_ptr<_cl_program>, cl_int> _cl_program::create(
context->getCompilerTarget(device));
}
}
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// GCC <9 requires this redundant move, this branch of the #if can be
// deleted once the minimum supported version of GCC is at least 9.
return std::move(program);
#else
return program;
#endif
}

// Used by clCreateProgramWithBinary.
Expand Down Expand Up @@ -650,13 +638,7 @@ cargo::expected<std::unique_ptr<_cl_program>, cl_int> _cl_program::create(
return cargo::make_unexpected(error);
}
program->type = cl::program_type::BINARY;
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// GCC <9 requires this redundant move, this branch of the #if can be
// deleted once the minimum supported version of GCC is at least 9.
return std::move(program);
#else
return program;
#endif
}

// Used by clCreateProgramWithBuiltInKernels.
Expand Down Expand Up @@ -752,13 +734,7 @@ cargo::expected<std::unique_ptr<_cl_program>, cl_int> _cl_program::create(
if (!program->finalize({device_list, num_devices})) {
return cargo::make_unexpected(CL_INVALID_VALUE);
}
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// GCC <9 requires this redundant move, this branch of the #if can be
// deleted once the minimum supported version of GCC is at least 9.
return std::move(program);
#else
return program;
#endif
}

// Used by clLinkProgram.
Expand Down Expand Up @@ -787,13 +763,7 @@ cargo::expected<std::unique_ptr<_cl_program>, cl_int> _cl_program::create(
if (!program->finalize(devices)) {
return cargo::make_unexpected(CL_LINK_PROGRAM_FAILURE);
}
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// GCC <9 requires this redundant move, this branch of the #if can be
// deleted once the minimum supported version of GCC is at least 9.
return std::move(program);
#else
return program;
#endif
}

cl_int _cl_program::compile(
Expand Down
6 changes: 0 additions & 6 deletions source/vk/source/pipeline_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,7 @@ cargo::error_or<cached_shader> cached_shader::clone() const {
} else {
return clone_descriptor_bindings.error();
}
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// GCC <9 requires this redundant move, this branch of the #if can be
// deleted once the minimum supported version of GCC is at least 9.
return std::move(clone);
#else
return clone;
#endif
}

bool cached_shader::operator==(const cached_shader &other) const {
Expand Down

0 comments on commit 95718ac

Please sign in to comment.