@@ -78,7 +78,7 @@ CudaCache::CudaCache(const CudaCacheProto& buf) {
78
78
entries_.emplace_back (entry_buf);
79
79
}
80
80
81
- CudaCache::CachedEntry::CachedEntry (
81
+ CudaCachedEntry::CudaCachedEntry (
82
82
const std::string& id,
83
83
const std::string& kernelSpecializedName,
84
84
const std::vector<int >& kernelParameters,
@@ -98,7 +98,7 @@ CudaCache::CachedEntry::CachedEntry(
98
98
values{cudaSource, kernelSpecializedName, kernelParameters, grid, block} {
99
99
}
100
100
101
- CudaCache::CachedEntry::CachedEntry (const CudaCacheEntryProto& buf)
101
+ CudaCachedEntry::CudaCachedEntry (const CudaCacheEntryProto& buf)
102
102
: key{buf.id (),
103
103
CudaMappingOptions{buf.kernel_options ()},
104
104
ProtoToTensorInfoVector (buf.inputs ()),
@@ -146,23 +146,23 @@ void CudaCache::cacheKernel(
146
146
CudaGPUInfo::GPUInfo ().GetCudaDeviceStr ());
147
147
}
148
148
149
- CudaCache::CachedEntry * CudaCache::searchKernel (
149
+ CudaCachedEntry * CudaCache::searchKernel (
150
150
const std::string& id,
151
151
const CudaMappingOptions& options,
152
152
const std::vector<detail::TensorInfo>& inputs,
153
153
const std::vector<detail::TensorInfo>& outputs) {
154
154
return searchKernelImpl (*this , id, options, inputs, outputs);
155
155
}
156
156
157
- CudaCache::CachedEntry * CudaCache::searchKernel (
157
+ CudaCachedEntry * CudaCache::searchKernel (
158
158
const std::string& id,
159
159
const CudaMappingOptions& options,
160
160
const std::vector<const DLTensor*>& inputs,
161
161
const std::vector<const DLTensor*>& outputs) {
162
162
return searchKernelImpl (*this , id, options, inputs, outputs);
163
163
}
164
164
165
- const CudaCache::CachedEntry * CudaCache::searchKernel (
165
+ const CudaCachedEntry * CudaCache::searchKernel (
166
166
const std::string& id,
167
167
const CudaMappingOptions& options,
168
168
const std::vector<const DLTensor*>& inputs,
@@ -351,21 +351,21 @@ void OptionsCache::recordRuntime(
351
351
v->recordedRuntimes .push_back (runtime);
352
352
}
353
353
354
- OptionsCache::CachedEntry * OptionsCache::searchKernel (
354
+ OptionsCachedEntry * OptionsCache::searchKernel (
355
355
const std::string& id,
356
356
const std::vector<const DLTensor*>& inputs,
357
357
const std::vector<const DLTensor*>& outputs) {
358
358
return searchKernelImpl (*this , id, inputs, outputs);
359
359
}
360
360
361
- const OptionsCache::CachedEntry * OptionsCache::searchKernel (
361
+ const OptionsCachedEntry * OptionsCache::searchKernel (
362
362
const std::string& id,
363
363
const std::vector<const DLTensor*>& inputs,
364
364
const std::vector<const DLTensor*>& outputs) const {
365
365
return searchKernelImpl (*this , id, inputs, outputs);
366
366
}
367
367
368
- OptionsCache::CachedEntry::CachedEntry (
368
+ OptionsCachedEntry::OptionsCachedEntry (
369
369
const std::string& id,
370
370
const std::vector<const DLTensor*>& inputs,
371
371
const std::vector<const DLTensor*>& outputs,
@@ -376,7 +376,7 @@ OptionsCache::CachedEntry::CachedEntry(
376
376
values.emplace_back (options, runtime);
377
377
}
378
378
379
- OptionsCache::CachedEntry ::Key::Key (
379
+ OptionsCachedEntry ::Key::Key (
380
380
const std::string& id,
381
381
const std::vector<const DLTensor*>& inputs_,
382
382
const std::vector<const DLTensor*>& outputs_,
@@ -388,7 +388,7 @@ OptionsCache::CachedEntry::Key::Key(
388
388
deviceStr,
389
389
gitVersion) {}
390
390
391
- OptionsCache::CachedEntry ::Key::Key (
391
+ OptionsCachedEntry ::Key::Key (
392
392
const std::string& id,
393
393
std::vector<detail::TensorInfo>&& inputs_,
394
394
std::vector<detail::TensorInfo>&& outputs_,
@@ -400,12 +400,12 @@ OptionsCache::CachedEntry::Key::Key(
400
400
deviceStr(deviceStr),
401
401
gitVersion(gitVersion) {}
402
402
403
- OptionsCache::CachedEntry ::Values::Values (
403
+ OptionsCachedEntry ::Values::Values (
404
404
const CudaMappingOptions& options,
405
405
Duration runtime)
406
406
: mappingOptions(options), recordedRuntimes{runtime} {}
407
407
408
- OptionsCache::CachedEntry ::Values::Values (
408
+ OptionsCachedEntry ::Values::Values (
409
409
const CudaMappingOptions& options,
410
410
std::vector<Duration>&& runtimes)
411
411
: mappingOptions(options), recordedRuntimes(std::move(runtimes)) {}
@@ -416,29 +416,21 @@ OptionsCache::OptionsCache(const OptionsCacheProto& buf) {
416
416
entries_.emplace_back (entry_buf);
417
417
}
418
418
419
- decltype (OptionsCache::entries_)::const_iterator OptionsCache::begin () const {
420
- return entries_.begin ();
421
- }
422
-
423
- decltype (OptionsCache::entries_)::const_iterator OptionsCache::end () const {
424
- return entries_.end ();
425
- }
426
-
427
- OptionsCache::CachedEntry::CachedEntry (const OptionsCacheEntryProto& buf)
419
+ OptionsCachedEntry::OptionsCachedEntry (const OptionsCacheEntryProto& buf)
428
420
: key(buf.id(),
429
421
ProtoToTensorInfoVector (buf.inputs()),
430
422
ProtoToTensorInfoVector(buf.outputs()),
431
423
buf.device_str(),
432
424
buf.git_version()) {
433
425
if (buf.values_size () == 0 ) {
434
426
throw std::invalid_argument (
435
- " OptionsCache::CachedEntry invalid protobuf: each entry should have at least one value field." );
427
+ " OptionsCachedEntry invalid protobuf: each entry should have at least one value field." );
436
428
}
437
429
438
430
for (const auto & value : buf.values ()) {
439
431
if (value.recorded_runtimes_size () == 0 ) {
440
432
throw std::invalid_argument (
441
- " OptionsCache::CachedEntry invalid protobuf: each entry value should have at least one recorded runtime." );
433
+ " OptionsCachedEntry invalid protobuf: each entry value should have at least one recorded runtime." );
442
434
}
443
435
std::vector<Duration> runtimes;
444
436
runtimes.reserve (value.recorded_runtimes_size ());
@@ -464,7 +456,7 @@ OptionsCacheProto OptionsCache::toProtobuf() const {
464
456
return buf;
465
457
}
466
458
467
- OptionsCacheEntryProto OptionsCache::CachedEntry ::toProtobuf () const {
459
+ OptionsCacheEntryProto OptionsCachedEntry ::toProtobuf () const {
468
460
OptionsCacheEntryProto buf;
469
461
buf.set_id (key.id );
470
462
std::transform (
@@ -509,7 +501,7 @@ CudaCacheProto CudaCache::toProtobuf() const {
509
501
return buf;
510
502
}
511
503
512
- CudaCacheEntryProto CudaCache::CachedEntry ::toProtobuf () const {
504
+ CudaCacheEntryProto CudaCachedEntry ::toProtobuf () const {
513
505
CudaCacheEntryProto buf;
514
506
buf.set_id (key.id );
515
507
*buf.mutable_kernel_options () = key.mappingOptions .proto ();
@@ -560,14 +552,14 @@ std::unique_ptr<CudaCache::RetrievalResult> ManualCudaCache::retrieveKernel(
560
552
entry->values .block });
561
553
}
562
554
563
- ManualCudaCache::CachedEntry * ManualCudaCache::searchKernel (
555
+ ManualCudaCachedEntry * ManualCudaCache::searchKernel (
564
556
const std::string& id,
565
557
const std::vector<const DLTensor*>& inputs,
566
558
const std::vector<const DLTensor*>& outputs) {
567
559
return searchKernelImpl (*this , id, inputs, outputs);
568
560
}
569
561
570
- const ManualCudaCache::CachedEntry * ManualCudaCache::searchKernel (
562
+ const ManualCudaCachedEntry * ManualCudaCache::searchKernel (
571
563
const std::string& id,
572
564
const std::vector<const DLTensor*>& inputs,
573
565
const std::vector<const DLTensor*>& outputs) const {
@@ -606,7 +598,7 @@ void ManualCudaCache::cacheKernel(
606
598
cudaSource,
607
599
CudaGPUInfo::GPUInfo ().GetCudaDeviceStr ());
608
600
}
609
- ManualCudaCache::CachedEntry::CachedEntry (
601
+ ManualCudaCachedEntry::ManualCudaCachedEntry (
610
602
const std::string& id,
611
603
const std::string& kernelSpecializedName,
612
604
const std::vector<int >& kernelParameters,
0 commit comments