From fa075091b5ef6ae363422bd9f5f4c8cf0e874868 Mon Sep 17 00:00:00 2001 From: Ben Sander Date: Thu, 13 Oct 2016 11:43:49 -0500 Subject: [PATCH] fix file-not-found detection Change-Id: Ida84923ed18b3ebf8ffcfd6ee84d8a72f611ecd3 --- src/hip_module.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hip_module.cpp b/src/hip_module.cpp index f556c85456..ecc449eddd 100644 --- a/src/hip_module.cpp +++ b/src/hip_module.cpp @@ -118,10 +118,10 @@ hipError_t hipModuleLoad(hipModule_t *module, const char *fname){ ihipDevice_t *currentDevice = ihipGetDevice(deviceId); std::ifstream in(fname, std::ios::binary | std::ios::ate); - if(!in){ + if(!in.is_open() ){ return ihipLogStatus(hipErrorFileNotFound); - }else{ + } else { *module = new ihipModule_t; size_t size = std::string::size_type(in.tellg());