Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warnings #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/semaphore
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ struct counting_semaphore
{
release(term, semaphore_notify_all, order);
}
__semaphore_abi inline void release(count_type term, semaphore_notify notify, std::memory_order order = std::memory_order_seq_cst) noexcept
__semaphore_abi inline void release(count_type term, semaphore_notify, std::memory_order order = std::memory_order_seq_cst) noexcept
{
count_type old = __frontbuffer.load(std::memory_order_relaxed);
while (1)
Expand Down Expand Up @@ -463,7 +463,7 @@ struct counting_semaphore
struct synchronic {

template <class T>
__semaphore_abi_a void signal(const atomic<T>* a, semaphore_notify notify = semaphore_notify_all) noexcept
__semaphore_abi_a void signal(const atomic<T>*, semaphore_notify notify = semaphore_notify_all) noexcept
{
#ifndef __semaphore_cuda
if (__semaphore_expect(!__reversebuffer.load(std::memory_order_relaxed), 1))
Expand Down
6 changes: 5 additions & 1 deletion lib/semaphore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ inline void __semaphore_wake_all(A &a)
template<class Fn>
__semaphore_abi bool __binary_semaphore_acquire_slow(
atomic<binary_semaphore::count_type>& atom, atomic<binary_semaphore::count_type>& ticket,
atomic<binary_semaphore::count_type>& tocket, bool const& stolen, Fn fn) noexcept
atomic<binary_semaphore::count_type>& tocket, bool const&, Fn fn) noexcept
{
uint32_t const tick = ticket.fetch_add(1, std::memory_order_relaxed);
uint32_t tock = tocket.load(std::memory_order_relaxed);
Expand Down Expand Up @@ -228,6 +228,8 @@ __semaphore_abi void binary_semaphore::__acquire_slow() noexcept
auto const fn = [=] __semaphore_abi (uint32_t old) -> bool {
#ifdef __semaphore_fast_path
details::__semaphore_wait(__atom, old);
#else
(void)old;
#endif
return true;
};
Expand All @@ -243,6 +245,8 @@ __semaphore_abi bool binary_semaphore::__acquire_slow_timed(std::chrono::time_po
auto rel_time = abs_time - details::__semaphore_clock::now();
if(rel_time > std::chrono::microseconds(0))
details::__semaphore_wait_timed(__atom, old, rel_time);
#else
(void)old;
#endif
return details::__semaphore_clock::now() < abs_time;
};
Expand Down
2 changes: 1 addition & 1 deletion test_defs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
using thread = std::thread;
using namespace std::experimental;
template<class F>
int start_gpu_threads(uint32_t count, F f) { assert(!count); return 0; }
int start_gpu_threads(uint32_t count, F) { assert(!count); return 0; }
void stop_gpu_threads(int) { }
uint32_t max_gpu_threads() { return 0; }
unsigned int dev = 0;
Expand Down