Skip to content

Instantly share code, notes, and snippets.

@elliottslaughter
Created June 17, 2025 18:14
Show Gist options
  • Select an option

  • Save elliottslaughter/468e6573f0f98349316cb8c21928ae51 to your computer and use it in GitHub Desktop.

Select an option

Save elliottslaughter/468e6573f0f98349316cb8c21928ae51 to your computer and use it in GitHub Desktop.
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive
COPY repro2.cc /repro2.cc
RUN apt-get update -qq && apt-get install -qq build-essential && g++ -shared -fPIC -o /librepro2.so /repro2.cc
#include <cstdio>
struct CUstream_st;
typedef CUstream_st *cudaStream_t;
#define CUstream cudaStream_t
static const CUstream INVALID_STREAM = reinterpret_cast<CUstream>(-1);
namespace ThreadLocal {
static thread_local CUstream current_stream = INVALID_STREAM;
};
static void cuhook_stream_callback()
{
if(ThreadLocal::current_stream == INVALID_STREAM) {
printf("[HELLO INVALID]: \n");
}
}
int test()
{
cuhook_stream_callback();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment