Skip to content

Instantly share code, notes, and snippets.

View enp1s0's full-sized avatar
🤯
Computing

tsuki enp1s0

🤯
Computing
View GitHub Profile
@enp1s0
enp1s0 / nan.cpp
Created December 4, 2019 04:42
is_nan
// https://en.wikipedia.org/wiki/Half-precision_floating-point_format
#include <cmath>
#include <iostream>
using half = std::uint16_t;
bool is_nan(const half a) {
return (((a >> 10) & 0x1f) == 0x1f) && (a & 0x3ff);
}

雑に使っているconfigureたち

Open MPI

../configure --with-cuda=$(realpath $(dirname $(which nvcc))/../) --prefix=

gcc

unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE 
@enp1s0
enp1s0 / check_error.cu
Last active August 27, 2022 02:39
cuda_check_error
#include <sstream>
#include <stdexcept>
inline void cuda_check_error(cudaError_t error, const std::string filename, const std::size_t line, const std::string funcname, const std::string message = ""){
if(error != cudaSuccess){
std::stringstream ss;
ss << cudaGetErrorString( error );
if(message.length() != 0){
ss << " : " << message;
}

高性能計算若手の会(仮名)

こういうことができたら良いな

  • [メイン] 共同研究のきっかけ作り
    • 要素技術と応用をつなげたり
      • アプリの人と数値線形代数の人をつなげたり
    • 実装が好きな人と理論が好きな人をつなげたり
      • こういう Nicholas HighamとJack Dongaraの組み合わせみたいなものが生まれると良いなーとか
  • [おまけ] インターンや就活の情報交換
@enp1s0
enp1s0 / main.cu
Last active December 11, 2023 15:10
CUDA error handle
#include <stdexcept>
#include <sstream>
#include <cuda_device_runtime_api.h>
#include <cuda.h>
#define CUDA_CHECK_ERROR(status) cuda_error_check(status, __FILE__, __LINE__, __func__)
inline void cuda_error_check(const cudaError_t error, const std::string filename, const std::size_t line, const std::string funcname, const std::string message = ""){
if(error != cudaSuccess){
std::stringstream ss;