Comments (5)
Are you asking about compiling the CUDA source file or the hipified HIP source file?
from hipify.
Hello, file HIPIFY/tests/unit_tests/samples/2_Cookbook/11_texture_driver
/tex2dKernel.cpp, this is the cuda source code from HIP to CUDA. It can be compiled using nvcc, but there is an extern variable in this file: extern texture<float, 2, cudaReadModeElementType> tex; I want to know how to use NVCC or hipcc to compile and generate tex2dKernel .code, thinks.
from hipify.
Hello, file HIPIFY/tests/unit_tests/samples/2_Cookbook/11_texture_driver /tex2dKernel.cpp, this is the cuda source code from HIP to CUDA. It can be compiled using nvcc, but there is an extern variable in this file: extern texture<float, 2, cudaReadModeElementType> tex; I want to know how to use NVCC or hipcc to compile and generate tex2dKernel .code, thinks.
I changed "extern texture<float, 2, cudaReadModeElementType> tex; "in tex2dKernel.cpp to "#if CUDA_VERSION < 12000 texture<float, 2, cudaReadModeElementType> tex;#endif" which is in texture2dDrv.cpp, then delete the definition of the variable tex in texture2dDrv.cpp, and then convert it into a HIP program. Using the hipcc --genco tex2dKernel.cpp -o tex2dKernel .code command to compile successfully, but if using extern variables in tex2dKernel.cpp, I donβt know how to generate tex2dKernel .code. How can I achieve this? Thanks.
from hipify.
The tex variable is not used in texture2dDrv.cpp. texture2dDrv.cpp only obtains tex in the form of a string through cuModuleGetTexRef(&texref, Module, "tex"); therefore, should the declaration and definition of tex be placed in tex2dKernel. cpp file? Thanks.
from hipify.
It is unclear, why you want to compile this particular hipify-clang unit test, which is dedicated to internal hipification testing only, and doesn't even have an entry point.
Anyway, you may do it by the following additional steps:
- Add an entry point to the tex2dKernel.cpp, for instance:
int main(int argc, char** argv) {
float out = 0.f;
tex2dKernel<<<512, 512>>>(&out, 128, 128);
return 0;
}
-
Compile the tex2dKernel.cpp by nvcc < 12.0.0 (because of the deleted texture support in CUDA 12.0):
a) without additional options to obtain executable;
b) with --cubin to generate a Cubin from PTX intermediate file;
c) with --fatbin to generate a Fat binary from the source.
or:
- Hipify the changed tex2dKernel.cpp source by hipify-clang.
- Compile the hipified tex2dKernel.cpp.hip either by hipcc script or directly by clang.
from hipify.
Related Issues (20)
- [HIPIFY][tests][failure] The synthetic test `cublas2rocblas.cu` is failed on CUDA 10.2 HOT 1
- [HIPIFY][doc][6.0.0][feature] Introduce the `C - Changed` column for HIP and ROC HOT 1
- [HIPIFY][perl] ROCm 5.7.1 on Almalinux (RHEL) has wrong path to findcode.sh HOT 2
- [HIPIFY] error: could not open ... coordinateSystem.prehip at /usr/bin/hipify-perl line 9986, <INFILE> chunk 20. HOT 1
- [HIPIFY] How to estimate the accuracy of converting HIP to CUDA or converting CUDA to HIP? HOT 2
- [HIPIFY] Isn't hipify-clang preprocessor based tool? HOT 4
- [HIPIFY] Makefile generation HOT 6
- [HIPIFY] Does HIPIFY support on WSL2? HOT 1
- [HIPIFY] hipify-clang terminates with constexpr function cannot overload function with same signature HOT 9
- [HIPIFY] Cuda graph HOT 2
- [HIPIFY][BLAS] cublasSetMathMode and CUBLAS_GEMM_DEFAULT_TENSOR_OP HOT 1
- [HIPIFY] Changing compiler and cuda environment related section to ROCm? HOT 3
- [HIPIFY][win] cannot find CUDA installation HOT 18
- [HIPIFY][tests][bug] `cusparse2rocsparse_10000.cu` failed with clang crash HOT 1
- [HIPIFY] How to hipify the programs based nvidia cutlass HOT 5
- [HIPIFY][build][LLVM] build fails, if multiple llvm/clang versions are installed HOT 4
- [HIPIFY] Linking fails when LLVM libraries were compiled as shared library. HOT 1
- [HIPIFY] hipconvertinplace-perl.sh does not seem to convert cuFuncSetAttribute and cuFuncSetCacheConfig HOT 2
- [HIPIFY] amd-staging branch build on Windows runs but doesn't replace anything in generated hip file HOT 9
- [HIPIFY][Issue]: "fatal error: '__clang_cuda_runtime_wrapper.h' file not found" while generating HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hipify.