This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from pydantic import BaseModel, ValidationError | |
from pydantic_settings import BaseSettings, SettingsConfigDict | |
class Config(BaseSettings): | |
model_config = SettingsConfigDict(env_prefix='my_prefix_', env_file=".env", extra="forbid") | |
foo: list[str] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cuda import cuda | |
# Error checking helper | |
def checkCudaErrors(result): | |
def _cudaGetErrorEnum(error): | |
if isinstance(error, cuda.CUresult): | |
err, name = cuda.cuGetErrorName(error) | |
return name if err == cuda.CUresult.CUDA_SUCCESS else "<unknown>" | |
elif isinstance(error, nvrtc.nvrtcResult): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# type: ignore | |
import ctypes | |
from typing import Any | |
import numpy as np | |
from cuda import cuda, cudart, nvrtc | |
do_bug = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
from typing import Any | |
import numpy as np | |
from cuda import cuda, cudart, nvrtc | |
cuda_code = """ | |
extern "C" __global__ void simple(char *str) { | |
printf("this is a test\\n"); | |
printf("passed argument was: %s\\n", str); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
from typing import Any | |
import numpy as np | |
from cuda import cuda, cudart, nvrtc | |
cuda_code = """ | |
extern "C" __global__ void simple(char *str) { | |
printf("this is a test\\n"); | |
printf("passed argument was: %s\\n", str); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Any | |
import numpy as np | |
from cuda import cuda, cudart, nvrtc | |
cuda_code = """ | |
extern "C" __global__ void simple() { | |
printf("this is a test\\n"); | |
} | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
from typing import Any | |
import numpy as np | |
from cuda import cuda, cudart, nvrtc | |
cuda_code = """ | |
extern "C" __global__ void simple(char *str) { | |
printf("this is a test\\n"); | |
printf("passed argument was: %s\\n", str); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# type: ignore | |
import numpy as np | |
from cuda import cuda, nvrtc | |
def _cudaGetErrorEnum(error): | |
if isinstance(error, cuda.CUresult): | |
err, name = cuda.cuGetErrorName(error) | |
return name if err == cuda.CUresult.CUDA_SUCCESS else "<unknown>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Any | |
import numpy as np | |
from cuda import cuda, cudart, nvrtc | |
cuda_code = """ | |
extern "C" __global__ void simple() { | |
printf("this is a test\\n"); | |
} | |
""" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder