Skip to content

Commit

Permalink
Fix additional warnings on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
umar456 authored and 9prady9 committed Nov 24, 2018
1 parent 675d610 commit fc7a7f7
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 20 deletions.
16 changes: 8 additions & 8 deletions src/backend/cpu/kernel/susan.hpp
Expand Up @@ -17,7 +17,7 @@ namespace kernel

template<typename T>
void susan_responses(Param<T> output, CParam<T> input,
const unsigned idim0, const unsigned idim1,
const dim_t idim0, const dim_t idim1,
const int radius, const float t, const float g,
const unsigned border_len)
{
Expand All @@ -27,9 +27,9 @@ void susan_responses(Param<T> output, CParam<T> input,
const unsigned r = border_len;
const int rSqrd = radius*radius;

for (unsigned y = r; y < idim1 - r; ++y) {
for (unsigned x = r; x < idim0 - r; ++x) {
const unsigned idx = y * idim0 + x;
for (dim_t y = r; y < idim1 - r; ++y) {
for (dim_t x = r; x < idim0 - r; ++x) {
const dim_t idx = y * idim0 + x;
T m_0 = in[idx];
float nM = 0.0f;

Expand All @@ -53,7 +53,7 @@ void susan_responses(Param<T> output, CParam<T> input,

template<typename T>
void non_maximal(Param<float> xcoords, Param<float> ycoords, Param<float> response,
shared_ptr<unsigned> counter, const unsigned idim0, const unsigned idim1,
shared_ptr<unsigned> counter, const dim_t idim0, const dim_t idim1,
CParam<T> input, const unsigned border_len, const unsigned max_corners)
{
float* x_out = xcoords.get();
Expand All @@ -65,8 +65,8 @@ void non_maximal(Param<float> xcoords, Param<float> ycoords, Param<float> respon
// Responses on the border don't have 8-neighbors to compare, discard them
const unsigned r = border_len + 1;

for (unsigned y = r; y < idim1 - r; y++) {
for (unsigned x = r; x < idim0 - r; x++) {
for (dim_t y = r; y < idim1 - r; y++) {
for (dim_t x = r; x < idim0 - r; x++) {
const T v = resp_in[y * idim0 + x];

// Find maximum neighborhood response
Expand All @@ -82,7 +82,7 @@ void non_maximal(Param<float> xcoords, Param<float> ycoords, Param<float> respon
// Stores corner to {x,y,resp}_out if it's response is maximum compared
// to its 8-neighborhood and greater or equal minimum response
if (v > max_v) {
const unsigned idx = *count;
const dim_t idx = *count;
*count += 1;
if (idx < max_corners) {
x_out[idx] = (float)x;
Expand Down
6 changes: 4 additions & 2 deletions src/backend/cpu/padarray.cpp
Expand Up @@ -27,7 +27,8 @@ template<typename T>
void multiply_inplace(Array<T> &in, double val)
{
in.eval();
getQueue().enqueue(kernel::copyElemwise<T, T>, in, in, 0, val);
getQueue().enqueue(kernel::copyElemwise<T, T>, in, in,
static_cast<T>(0), val);
}

template<typename inType, typename outType>
Expand All @@ -37,7 +38,8 @@ Array<outType> padArray(const Array<inType>& in, const dim4& dims,
Array<outType> ret = createValueArray<outType>(dims, default_value);
ret.eval();
in.eval();
getQueue().enqueue(kernel::copyElemwise<outType, inType>, ret, in, outType(default_value), factor);
getQueue().enqueue(kernel::copyElemwise<outType, inType>, ret, in,
static_cast<outType>(default_value), factor);

return ret;
}
Expand Down
27 changes: 18 additions & 9 deletions src/backend/opencl/magma/magma_blas_clblast.h
Expand Up @@ -91,8 +91,9 @@ struct gpu_blas_gemm_func
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
const cl_mem b_buffer, const size_t b_offset, const size_t b_ld, const T beta,
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
cl_uint num_queues, cl_command_queue *queues, cl_uint num_wait_events, const cl_event */*wait_events*/, cl_event *events)
cl_uint num_queues, cl_command_queue *queues, cl_uint num_wait_events, const cl_event wait_events, cl_event *events)
{
UNUSED(wait_events);
assert(num_queues == 1);
assert(num_wait_events == 0);
const auto alpha_clblast = toCLBlastConstant(alpha);
Expand All @@ -112,8 +113,9 @@ struct gpu_blas_gemv_func
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc, const T beta,
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
cl_uint num_queues, cl_command_queue *queues, cl_uint num_wait_events, const cl_event */*wait_events*/, cl_event *events)
cl_uint num_queues, cl_command_queue *queues, cl_uint num_wait_events, const cl_event *wait_events, cl_event *events)
{
UNUSED(wait_events);
assert(num_queues == 1);
assert(num_wait_events == 0);
const auto alpha_clblast = toCLBlastConstant(alpha);
Expand All @@ -132,8 +134,9 @@ struct gpu_blas_trmm_func
const size_t m, const size_t n, const T alpha,
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
cl_uint num_queues, cl_command_queue *queues, cl_uint num_wait_events, const cl_event */*wait_events*/, cl_event *events)
cl_uint num_queues, cl_command_queue *queues, cl_uint num_wait_events, const cl_event *wait_events, cl_event *events)
{
UNUSED(wait_events);
assert(num_queues == 1);
assert(num_wait_events == 0);
const auto alpha_clblast = toCLBlastConstant(alpha);
Expand All @@ -151,8 +154,9 @@ struct gpu_blas_trsm_func
const size_t m, const size_t n, const T alpha,
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
cl_uint num_queues, cl_command_queue *queues, cl_uint num_wait_events, const cl_event */*wait_events*/, cl_event *events)
cl_uint num_queues, cl_command_queue *queues, cl_uint num_wait_events, const cl_event *wait_events, cl_event *events)
{
UNUSED(wait_events);
assert(num_queues == 1);
assert(num_wait_events == 0);
const auto alpha_clblast = toCLBlastConstant(alpha);
Expand All @@ -170,8 +174,9 @@ struct gpu_blas_trsv_func
const size_t n,
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
cl_uint num_queues, cl_command_queue *queues, cl_uint num_wait_events, const cl_event */*wait_events*/, cl_event *events)
cl_uint num_queues, cl_command_queue *queues, cl_uint num_wait_events, const cl_event *wait_events, cl_event *events)
{
UNUSED(wait_events);
assert(num_queues == 1);
assert(num_wait_events == 0);
return clblast::Trsv<typename CLBlastType<T>::Type>(
Expand All @@ -191,8 +196,9 @@ struct gpu_blas_herk_func
const size_t n, const size_t k, const BasicType alpha,
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld, const BasicType beta,
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
cl_uint num_queues, cl_command_queue *queues, cl_uint num_wait_events, const cl_event */*wait_events*/, cl_event *events)
cl_uint num_queues, cl_command_queue *queues, cl_uint num_wait_events, const cl_event *wait_events, cl_event *events)
{
UNUSED(wait_events);
assert(num_queues == 1);
assert(num_wait_events == 0);
const auto alpha_clblast = toCLBlastConstant(alpha);
Expand All @@ -212,8 +218,9 @@ struct gpu_blas_herk_func<float>
const size_t n, const size_t k, const float alpha,
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld, const float beta,
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
cl_uint num_queues, cl_command_queue *queues, cl_uint num_wait_events, const cl_event */*wait_events*/, cl_event *events)
cl_uint num_queues, cl_command_queue *queues, cl_uint num_wait_events, const cl_event *wait_events, cl_event *events)
{
UNUSED(wait_events);
assert(num_queues == 1);
assert(num_wait_events == 0);
const auto alpha_clblast = toCLBlastConstant(alpha);
Expand All @@ -233,8 +240,9 @@ struct gpu_blas_herk_func<double>
const size_t n, const size_t k, const double alpha,
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld, const double beta,
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
cl_uint num_queues, cl_command_queue *queues, cl_uint num_wait_events, const cl_event */*wait_events*/, cl_event *events)
cl_uint num_queues, cl_command_queue *queues, cl_uint num_wait_events, const cl_event *wait_events, cl_event *events)
{
UNUSED(wait_events);
assert(num_queues == 1);
assert(num_wait_events == 0);
const auto alpha_clblast = toCLBlastConstant(alpha);
Expand All @@ -253,8 +261,9 @@ struct gpu_blas_syrk_func
const size_t n, const size_t k, const T alpha,
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld, const T beta,
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
cl_uint num_queues, cl_command_queue *queues, cl_uint num_wait_events, const cl_event */*wait_events*/, cl_event *events)
cl_uint num_queues, cl_command_queue *queues, cl_uint num_wait_events, const cl_event *wait_events, cl_event *events)
{
UNUSED(wait_events);
assert(num_queues == 1);
assert(num_wait_events == 0);
const auto alpha_clblast = toCLBlastConstant(alpha);
Expand Down
2 changes: 1 addition & 1 deletion test/testHelpers.hpp
Expand Up @@ -539,7 +539,7 @@ const af::cdouble& operator+(const af::cdouble& val) {

// Calculate a multi-dimensional coordinates' linearized index
dim_t ravelIdx(af::dim4 coords, af::dim4 strides) {
return std::inner_product(coords.get(), coords.get()+4, strides.get(), 0);
return std::inner_product(coords.get(), coords.get()+4, strides.get(), 0LL);
}

// Calculate a linearized index's multi-dimensonal coordinates in an af::array,
Expand Down

0 comments on commit fc7a7f7

Please sign in to comment.