cumo 0.3.1 → 0.3.2

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: 8f07518545c0e4d72380382915462039151c132ee9827967e9d4c32604001f15
4
- data.tar.gz: 94e5c261659e401d9a8016eb0a3493d9bce26abe19347602859f7a9fcc79014e
3
+ metadata.gz: 5b17317cc0df56b966f0455be514318920624fb5869e45d442a81d3f71ee9e9d
4
+ data.tar.gz: 50e06b7373b2d0a97c6c715686fc7a38b58fbeb86d17aa8ad189e0a1d9828a5c
5
5
  SHA512:
6
- metadata.gz: cf48d1e5452e2c871587da1f006b90f3de54c8dc911d4fa555bd54c7ea69741903ce000fd0b1fd38ba96fc46d65e79f24e3c9d858029df176cee7768e8de790b
7
- data.tar.gz: 4c5d6bdc9ec211967458b9b4f3576a278b2d59011faf2ae5dd85979a4821496ad29db9eefd0fce9d0765f9ede38d42af2c8fc8dd250de41f9e22759ee9914a56
6
+ metadata.gz: f558130296b89c55e5d506673dd3376274f95c57970cd6aa17d686e69c2e23e41d85a16fdfb84fcb7a4acc6addbd67ea855800de8eb1fa1e6b1bf4d061894109
7
+ data.tar.gz: 642442d479765d459286474a514e047ab80273b9357b357f5509054f27cd52c27562f57c8af53a4efa5d8cb24afd4c2949afe1f2b962b9046ea4fd23935666b1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.3.2 (2019-05-02)
2
+
3
+ Fixes:
4
+
5
+ * Fix max and max\_index for sfloat and dfloat
6
+
1
7
  # 0.3.1 (2019-04-16)
2
8
 
3
9
  Fixes:
@@ -210,6 +210,7 @@ static void HashCombine(std::size_t& seed, std::size_t hash_value) {
210
210
 
211
211
  // Partially Borrowed from ChainerX
212
212
  struct AlgoCacheKey {
213
+ int device_id;
213
214
  size_t ndim; // # of spatial dimensions
214
215
  size_t x_shape[CUMO_NA_MAX_DIMENSION];
215
216
  size_t w_shape[CUMO_NA_MAX_DIMENSION];
@@ -220,6 +221,7 @@ struct AlgoCacheKey {
220
221
  size_t max_workspace_size;
221
222
 
222
223
  bool operator==(const AlgoCacheKey& other) const {
224
+ if (device_id != other.device_id) return false;
223
225
  if (ndim != other.ndim) return false;
224
226
  if (dtype != other.dtype) return false;
225
227
  if (max_workspace_size != other.max_workspace_size) return false;
@@ -249,6 +251,7 @@ struct AlgoCacheKeyHash {
249
251
  std::size_t operator()(const AlgoCacheKey& key) const {
250
252
  std::size_t seed = 0;
251
253
  size_t ndim = key.ndim;
254
+ HashCombine(seed, std::hash<int>()(key.device_id));
252
255
  HashCombine(seed, std::hash<size_t>()(key.ndim));
253
256
  for (size_t idim = 0; idim < ndim + 2; ++idim) {
254
257
  HashCombine(seed, std::hash<size_t>()(key.x_shape[idim]));
@@ -275,7 +278,6 @@ using FwdAlgoCacheMap = std::unordered_map<AlgoCacheKey, std::pair<cudnnConvolut
275
278
  using BwdDataAlgoCacheMap = std::unordered_map<AlgoCacheKey, std::pair<cudnnConvolutionBwdDataAlgo_t, size_t>, AlgoCacheKeyHash>;
276
279
  using BwdFilterAlgoCacheMap = std::unordered_map<AlgoCacheKey, std::pair<cudnnConvolutionBwdFilterAlgo_t, size_t>, AlgoCacheKeyHash>;
277
280
 
278
- // TODO: Another cache for another device
279
281
  static FwdAlgoCacheMap fwd_algo_cache_map_{};
280
282
  static BwdDataAlgoCacheMap bwd_data_algo_cache_map_{};
281
283
  static BwdFilterAlgoCacheMap bwd_filter_algo_cache_map_{};
@@ -304,6 +306,7 @@ cumo_cuda_cudnn_FindConvolutionForwardAlgorithm(
304
306
  CumoGetNArray(y, ny);
305
307
 
306
308
  auto key = AlgoCacheKey{};
309
+ cumo_cuda_runtime_check_status(cudaGetDevice(&(key.device_id)));
307
310
  key.ndim = ndim;
308
311
  for (size_t idim = 0; idim < ndim + 2; ++idim) {
309
312
  key.x_shape[idim] = nx->shape[idim];
@@ -10,8 +10,8 @@ extern "C" {
10
10
  #endif
11
11
  #endif
12
12
 
13
- #define CUMO_VERSION "0.3.1"
14
- #define CUMO_VERSION_CODE 31
13
+ #define CUMO_VERSION "0.3.2"
14
+ #define CUMO_VERSION_CODE 32
15
15
 
16
16
  bool cumo_compatible_mode_enabled_p();
17
17
  bool cumo_show_warning_enabled_p();
@@ -44,5 +44,5 @@ inline static void m_rand_norm(dtype mu, dtype sigma, dtype *a0, dtype *a1)
44
44
  #define M_MIN rb_float_new(2.2250738585072014e-308)
45
45
  #define M_MAX rb_float_new(1.7976931348623157e+308)
46
46
 
47
- #define DATA_MIN DBL_MIN
47
+ #define DATA_MIN -DBL_MAX
48
48
  #define DATA_MAX DBL_MAX
@@ -8,7 +8,7 @@ typedef double rtype;
8
8
 
9
9
  #define m_nearly_eq(x,y) (fabs(x-y)<=(fabs(x)+fabs(y))*DBL_EPSILON*2)
10
10
 
11
- #define DATA_MIN DBL_MIN
11
+ #define DATA_MIN -DBL_MAX
12
12
  #define DATA_MAX DBL_MAX
13
13
 
14
14
  #endif // CUMO_DFLOAT_KERNEL_H
@@ -45,5 +45,5 @@ inline static void m_rand_norm(dtype mu, dtype sigma, dtype *a0, dtype *a1)
45
45
  #define M_MIN rb_float_new(1.1754943508222875e-38)
46
46
  #define M_MAX rb_float_new(3.4028234663852886e+38)
47
47
 
48
- #define DATA_MIN FLT_MIN
48
+ #define DATA_MIN -FLT_MAX
49
49
  #define DATA_MAX FLT_MAX
@@ -8,7 +8,7 @@ typedef float rtype;
8
8
 
9
9
  #define m_nearly_eq(x,y) (fabs(x-y)<=(fabs(x)+fabs(y))*FLT_EPSILON*2)
10
10
 
11
- #define DATA_MIN FLT_MIN
11
+ #define DATA_MIN -FLT_MAX
12
12
  #define DATA_MAX FLT_MAX
13
13
 
14
14
  #endif // CUMO_SFLOAT_KERNEL_H
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.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-16 00:00:00.000000000 Z
11
+ date: 2019-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: numo-narray