Java fix for CPU build

This commit is contained in:
Ryan Hill 2021-05-10 13:03:17 -07:00
parent 912b61e490
commit 12224c88b7
2 changed files with 4 additions and 2 deletions

View file

@ -219,6 +219,9 @@ final class OnnxRuntime {
logger.log(Level.FINE, "Extracted native library '" + library + "' from resource path");
}
}
} catch(Exception e) {
if(systemLoad) // We only throw if we're loading the library, otherwise failure is okay
throw e;
} finally {
cleanUp(tempFile, !systemLoad);
}

View file

@ -492,7 +492,7 @@ static AllocatorPtr GetCudaAllocator(OrtDevice::DeviceId id) {
if (id_to_allocator_map->find(id) == id_to_allocator_map->end()) {
// TODO: Expose knobs so that users can set fields associated with OrtArenaCfg so that we can pass it to the following method
id_to_allocator_map->insert({id, GetProviderInfo_CUDA()->CreateCudaAllocator(id, gpu_mem_limit, arena_extend_strategy, external_allocator_info)});
id_to_allocator_map->insert({id, GetProviderInfo_CUDA()->CreateCudaAllocator(id, gpu_mem_limit, arena_extend_strategy, external_allocator_info, nullptr)});
}
return (*id_to_allocator_map)[id];
@ -2155,4 +2155,3 @@ onnxruntime::Environment& GetEnv() {
} // namespace python
} // namespace onnxruntime