cumo 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e5501440404744a0b6980679ea26ddde26969d50954e96025e7e561264f66c6
4
- data.tar.gz: 8c34c90b27aa7c6dc75bfa712d16178113e6f725f9e6fcaf7cb4cdb4daf3c556
3
+ metadata.gz: 981428686ca946222ba4e575d35d55cc1139ae9a057afe11bb19166d189ddd4d
4
+ data.tar.gz: 88129353d1da98170baa4362b46032ffa49b236e7559f1c5e60a6bfa32192c7c
5
5
  SHA512:
6
- metadata.gz: 788891f3d1a7397f8d0dd8213d7fbc9bac536bbaff5d1bdc87502501367182a3cad8b3e48542ba94951d16cd2fd7b90ada9190e56dda81199c3d9eff905bc4ce
7
- data.tar.gz: 44782255ca4e27c4ac01b6596a833a0796fdc849fea4d64e8b0109810a638b6ae8f55ccc5ac8db216d48c7402c0597124f63e0e9afcf198961e06bba667824ef
6
+ metadata.gz: 7f2cfcf951e787490e427ad6688e8003b7a0d9132e5cf1a030b78727561ddbf603df367e71169f91e926b67660b40f0b1c66f26ab30c744e8afb680d9568bfa7
7
+ data.tar.gz: 1c47cb15aa0676369c37cc8a77771e7b498b56fbcb7f8b6321db4c3a9c1a24e3cb8a1fdb37e9b72331441458458b943a36fe34bc2b01706998c9fa50d06413be
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.2.4 (2018-11-21)
2
+
3
+ Changes:
4
+
5
+ * Turn off `CUMO_SHOW_WARNING` as default
6
+
1
7
  # 0.2.3 (2018-11-17)
2
8
 
3
9
  Enhancements:
@@ -17,8 +23,7 @@ Enhancements:
17
23
 
18
24
  Enhancements:
19
25
 
20
- * Add `CUMO_SHOW_WARNING` and `CUMO_SHOW_WARNING_ONCE` environment variables to suppress cumo warnings.
21
- * They are only for debug purpose, would be removed in future.
26
+ * Add `CUMO_SHOW_WARNING` and `CUMO_SHOW_WARNING_ONCE` environment variables to suppress cumo warnings (They are only for debug purpose, would be removed in future).
22
27
 
23
28
  # 0.2.0 (2018-11-12)
24
29
 
data/README.md CHANGED
@@ -104,9 +104,9 @@ You may enable or disable `compatible_mode` as:
104
104
  ```
105
105
  require 'cumo'
106
106
  Cumo.enable_compatible_mode # enable
107
- Cumo.compattible_mode_enabled? #=> true
107
+ Cumo.compatible_mode_enabled? #=> true
108
108
  Cumo.disable_compatible_mode # disable
109
- Cumo.compattible_mode_enabled? #=> false
109
+ Cumo.compatible_mode_enabled? #=> false
110
110
  ```
111
111
 
112
112
  You can also use following methods which behaves as Numo NArray's methods. Behaviors of these methods do not depend on `compatible_mode`.
@@ -242,17 +242,16 @@ bundle exec DTYPE=dfloat ruby test/narray_test.rb
242
242
  bundle exec CUDA_LAUNCH_BLOCKING=1
243
243
  ```
244
244
 
245
- ### Disable Cumo warnings
245
+ ### Show GPU synchnoziation warnings
246
246
 
247
- As default, cumo shows some warnings once for each.
248
-
249
- It is possible to disable by followings:
247
+ Cumo shows warnings if CPU and GPU synchronization occurs if:
250
248
 
251
249
  ```
252
- export CUMO_SHOW_WARNING=OFF
250
+ export CUMO_SHOW_WARNING=ON
253
251
  ```
254
252
 
255
- You may want to show warnings everytime rather than once:
253
+ As default, it shows warnings occurred at the same place only once.
254
+ You may want to show warnings everytime rather than once as:
256
255
 
257
256
  ```
258
257
  export CUMO_SHOW_WARNING=ON
data/ext/cumo/cumo.c CHANGED
@@ -124,9 +124,9 @@ Init_cumo()
124
124
  env = getenv("CUMO_COMPATIBLE_MODE");
125
125
  cumo_compatible_mode_enabled = (env != NULL && strcmp(env, "OFF") != 0 && strcmp(env, "0") != 0 && strcmp(env, "NO") != 0);
126
126
 
127
- // default is true
127
+ // default is false
128
128
  env = getenv("CUMO_SHOW_WARNING");
129
- cumo_show_warning_enabled = env == NULL || (strcmp(env, "OFF") != 0 && strcmp(env, "0") != 0 && strcmp(env, "NO") != 0);
129
+ cumo_show_warning_enabled = (env != NULL && strcmp(env, "OFF") != 0 && strcmp(env, "0") != 0 && strcmp(env, "NO") != 0);
130
130
 
131
131
  // default is true
132
132
  env = getenv("CUMO_SHOW_WARNING_ONCE");
@@ -10,8 +10,8 @@ extern "C" {
10
10
  #endif
11
11
  #endif
12
12
 
13
- #define CUMO_VERSION "0.2.3"
14
- #define CUMO_VERSION_CODE 23
13
+ #define CUMO_VERSION "0.2.4"
14
+ #define CUMO_VERSION_CODE 24
15
15
 
16
16
  bool cumo_compatible_mode_enabled_p();
17
17
  bool cumo_show_warning_enabled_p();
@@ -183,6 +183,9 @@ print_ndloop(cumo_na_md_loop_t *lp) {
183
183
  printf(" xargs[%d].bufcp->ndim = %d\n", j, lp->xargs[j].bufcp->ndim);
184
184
  printf(" xargs[%d].bufcp->elmsz = %"SZF"d\n", j, lp->xargs[j].bufcp->elmsz);
185
185
  printf(" xargs[%d].bufcp->n = 0x%"SZF"x\n", j, (size_t)lp->xargs[j].bufcp->n);
186
+ for (i=0; i<=lp->xargs[j].bufcp->ndim; i++) {
187
+ printf(" xargs[%d].bufcp->n[%d] = %"SZF"u\n", j, i, lp->xargs[j].bufcp->n[i]);
188
+ }
186
189
  printf(" xargs[%d].bufcp->src_ptr = 0x%"SZF"x\n", j, (size_t)lp->xargs[j].bufcp->src_ptr);
187
190
  printf(" xargs[%d].bufcp->buf_ptr = 0x%"SZF"x\n", j, (size_t)lp->xargs[j].bufcp->buf_ptr);
188
191
  printf(" xargs[%d].bufcp->src_iter = 0x%"SZF"x\n", j, (size_t)lp->xargs[j].bufcp->src_iter);
@@ -1256,7 +1259,7 @@ ndloop_copy_from_buffer(cumo_na_buffer_copy_t *lp)
1256
1259
  DBG(for (j=0; j<elmsz/8; j++) {printf("%g,",((double*)(src))[j]);});
1257
1260
  goto loop_end;
1258
1261
  }
1259
- // initialize loop counter
1262
+ // initialize loop counter. c[i] indicates an element index of i-th dim.
1260
1263
  c = ALLOCA_N(size_t, nd+1);
1261
1264
  for (i=0; i<=nd; i++) c[i]=0;
1262
1265
  // loop body
@@ -1283,6 +1286,8 @@ ndloop_copy_from_buffer(cumo_na_buffer_copy_t *lp)
1283
1286
  DBG(for (j=0; j<elmsz/8; j++) {printf("%g,",((double*)(src))[j]);});
1284
1287
  buf_pos += elmsz;
1285
1288
  // count up
1289
+ // ++c[i] and goes to the next element of i-th dim if c[i] < lp->n[i]
1290
+ // If c[i] == lp->n[i], a loop for i-th dim ends. Goes to (i-1)-th dim.
1286
1291
  for (;;) {
1287
1292
  if (i<=0) goto loop_end;
1288
1293
  i--;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cumo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-17 00:00:00.000000000 Z
11
+ date: 2018-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: numo-narray