Skip to content

Commit

Permalink
Cleaned up warnings about type-conversions (ILP64).
Browse files Browse the repository at this point in the history
  • Loading branch information
hfp committed Sep 5, 2019
1 parent fab8dfd commit 0ccc721
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions samples/transpose/transpose.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ int main(int argc, char* argv[])
ITRANS(b, sizeof(ELEM_TYPE), km, kn, kldi);
}
}
size += sizeof(ELEM_TYPE) * km * kn;
size += (size_t)(sizeof(ELEM_TYPE) * km * kn);

if (('o' == t || 'O' == t)) {
#if !defined(USE_REFERENCE)
Expand Down Expand Up @@ -240,7 +240,7 @@ int main(int argc, char* argv[])
}
else {
assert(('i' == t || 'I' == t) && kldo == kldi);
memcpy(b, a, sizeof(ELEM_TYPE) * kldi * kn);
memcpy(b, a, (size_t)(sizeof(ELEM_TYPE) * kldi * kn));

if (2 > tasks) { /* library-internal parallelization */
start = libxsmm_timer_tick();
Expand Down Expand Up @@ -339,7 +339,7 @@ int main(int argc, char* argv[])
if (0 < duration) {
/* out-of-place transpose bandwidth assumes RFO */
fprintf(stdout, "\tbandwidth: %.1f GB/s\n", size
* ((('o' == t || 'O' == t)) ? 3 : 2) / (d * (1ULL << 30)));
* ((('o' == t || 'O' == t)) ? 3 : 2) / (d * (1U << 30)));
}
if (0 == lower) {
fprintf(stdout, "\tduration: %.0f ms\n", 1000.0 * (d / (0 == r ? (s + 1) : s)));
Expand Down
2 changes: 1 addition & 1 deletion samples/utilities/rng/rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int main(int argc, char* argv[])
num_rngs = LIBXSMM_UP2(num_rngs, 16);
assert(num_rngs >= 1);

rngs = (float*)malloc(sizeof(float) * num_rngs);
rngs = (float*)malloc((size_t)(sizeof(float) * num_rngs));
if (NULL == rngs) num_rngs = 0;

libxsmm_rng_set_seed( (unsigned int)(time(0)) );
Expand Down
12 changes: 6 additions & 6 deletions src/libxsmm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ LIBXSMM_API_INTERN void internal_finalize(void)
size_private = scratch_info.internal;
size_scratch = scratch_info.size;
}
fprintf(stderr, "Memory: %.f MB", 1.0 * (internal_registry_nbytes + size_private) / (1ULL << 20));
fprintf(stderr, "Memory: %.f MB", 1.0 * ((unsigned long long)internal_registry_nbytes + size_private) / (1ULL << 20));
if (0 != high_verbosity) {
size_t ngemms = 0;
int i; for (i = 0; i < 4; ++i) {
Expand Down Expand Up @@ -658,8 +658,8 @@ LIBXSMM_API_INTERN void internal_init(void)
}
LIBXSMM_ASSERT(1 <= libxsmm_scratch_scale);
}
libxsmm_scratch_limit = internal_parse_nbytes(getenv("LIBXSMM_SCRATCH_LIMIT"),
(size_t)LIBXSMM_MALLOC_SCRATCH_LIMIT);
libxsmm_scratch_limit = internal_parse_nbytes(
getenv("LIBXSMM_SCRATCH_LIMIT"), LIBXSMM_MALLOC_SCRATCH_LIMIT);
#endif /*defined(LIBXSMM_MALLOC_SCRATCH_MAX_NPOOLS) && (0 < (LIBXSMM_MALLOC_SCRATCH_MAX_NPOOLS))*/
#if defined(LIBXSMM_MAXTARGET)
libxsmm_set_target_arch(LIBXSMM_STRINGIFY(LIBXSMM_MAXTARGET));
Expand Down Expand Up @@ -748,8 +748,8 @@ LIBXSMM_API_INTERN void internal_init(void)
const libxsmm_free_function null_free_fn = { 0 };
const char *const env = getenv("LIBXSMM_MALLOC");
if (NULL != env && 0 != *env) libxsmm_malloc_kind = atoi(env);
libxsmm_malloc_threshold = internal_parse_nbytes(getenv("LIBXSMM_MALLOC_THRESHOLD"),
(size_t)LIBXSMM_MALLOC_THRESHOLD);
libxsmm_malloc_threshold = internal_parse_nbytes(
getenv("LIBXSMM_MALLOC_THRESHOLD"), LIBXSMM_MALLOC_THRESHOLD);
libxsmm_xset_default_allocator(NULL/*lock*/, NULL/*context*/, null_malloc_fn, null_free_fn);
libxsmm_xset_scratch_allocator(NULL/*lock*/, NULL/*context*/, null_malloc_fn, null_free_fn);
}
Expand Down Expand Up @@ -783,7 +783,7 @@ LIBXSMM_API_INTERN void internal_init(void)
LIBXSMM_API LIBXSMM_ATTRIBUTE_CTOR void libxsmm_init(void)
{
if (0 == LIBXSMM_ATOMIC_LOAD(&internal_registry, LIBXSMM_ATOMIC_RELAXED)) {
/* libxsmm_ninit (1: started, 2: library initialized), invalidate code-TLS, never decremented */
/* libxsmm_ninit (1: started, 2: library initialized), invalidate code-TLS */
if (1 == LIBXSMM_ATOMIC_ADD_FETCH(&libxsmm_ninit, 1, LIBXSMM_ATOMIC_SEQ_CST)) {
#if (0 != LIBXSMM_SYNC)
# if defined(LIBXSMM_REGLOCK_TRY)
Expand Down
2 changes: 1 addition & 1 deletion src/libxsmm_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# define LIBXSMM_MALLOC_SCRATCH_MAX_NPOOLS LIBXSMM_MAX_NTHREADS
#endif
#if !defined(LIBXSMM_MALLOC_SCRATCH_LIMIT)
# define LIBXSMM_MALLOC_SCRATCH_LIMIT (4ULL << 30) /* 4 GB */
# define LIBXSMM_MALLOC_SCRATCH_LIMIT 0xFFFFFFFF /* ~4 GB */
#endif
#if !defined(LIBXSMM_MALLOC_SCRATCH_SCALE)
# define LIBXSMM_MALLOC_SCRATCH_SCALE 1.0
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
master-1.13-196
master-1.13-197

0 comments on commit 0ccc721

Please sign in to comment.