Skip to content

Commit

Permalink
优化GPU加速代码
Browse files Browse the repository at this point in the history
  • Loading branch information
XUANXUQAQ committed May 6, 2023
1 parent b79bdd6 commit 94c0644
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions C++/cudaAccelerator/cudaAccelerator/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,8 +990,8 @@ void create_and_insert_cache(const std::vector<std::string>& records_vec, const
cache->str_data.str_total_bytes = alloc_bytes;
cache->str_data.str_remain_blank_bytes = CACHE_REMAIN_BLANK_SIZE_IN_BYTES;

auto str_addr_capacity = record_count + CACHE_REMAIN_BLANK_SIZE_IN_BYTES / MAX_PATH_LENGTH;
auto str_addr_alloc_size = str_addr_capacity * sizeof(size_t);
const auto str_addr_capacity = record_count + CACHE_REMAIN_BLANK_SIZE_IN_BYTES / MAX_PATH_LENGTH;
const auto str_addr_alloc_size = str_addr_capacity * sizeof(size_t);
gpuErrchk(cudaMalloc(&cache->str_data.dev_str_addr, str_addr_alloc_size), true, nullptr);
gpuErrchk(cudaMemset(cache->str_data.dev_str_addr, 0, str_addr_alloc_size), true, nullptr);
cache->str_data.str_addr_capacity = str_addr_capacity;
Expand Down
2 changes: 1 addition & 1 deletion C++/openclAccelerator/src/file_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ std::wstring string2wstring(const std::string& str)
int is_dir_or_file(const char* path)
{
const auto w_path = string2wstring(path);
DWORD dwAttrib = GetFileAttributes(w_path.c_str());
const DWORD dwAttrib = GetFileAttributes(w_path.c_str());
if (dwAttrib != INVALID_FILE_ATTRIBUTES)
{
if (dwAttrib & FILE_ATTRIBUTE_DIRECTORY)
Expand Down
Binary file modified src/main/resources/win32-native/cudaAccelerator.dll
Binary file not shown.
Binary file modified src/main/resources/win32-native/openclAccelerator.dll
Binary file not shown.

0 comments on commit 94c0644

Please sign in to comment.