Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to build on Linux #282

Open
fulalas opened this issue Oct 11, 2024 · 1 comment
Open

Fail to build on Linux #282

fulalas opened this issue Oct 11, 2024 · 1 comment

Comments

@fulalas
Copy link

fulalas commented Oct 11, 2024

Trying to build from git master, on PorteuX 1.6 (Slackware current based).
rustc 1.83.0-nightly (52fd99839 2024-10-10)
llvm-18.1.8

Command used to build: CC=clang CXX=clang++ cargo build --release
Trying with GCC 14.2.0 doesn't change anything.

Error:

error[E0432]: unresolved import `hip_runtime_sys::hipGetDeviceProperties`
 --> zluda/src/impl/link.rs:6:52
  |
6 | use hip_runtime_sys::{hipCtxGetDevice, hipError_t, hipGetDeviceProperties};
  |                                                    ^^^^^^^^^^^^^^^^^^^^^^
  |                                                    |
  |                                                    no `hipGetDeviceProperties` in the root
  |                                                    help: a similar name exists in the module: `hipGetDevicePropertiesR0600`

error[E0532]: expected tuple struct or tuple variant, found type alias `hip_runtime_sys::hipError_t`
   --> zluda/src/impl/mod.rs:169:13
    |
169 |             hip_runtime_sys::hipError_t(e) => CUresult(e),
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: can't use a type alias as a constructor

warning: unused `#[macro_use]` import
 --> zluda/src/lib.rs:1:1
  |
1 | #[macro_use]
  | ^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused imports: `CUctx_st`, `CUdevice`, `CUfunc_st`, `CUmod_st`, and `CUstream_st`
 --> zluda/src/impl/mod.rs:3:19
  |
3 | use crate::cuda::{CUctx_st, CUdevice, CUdeviceptr, CUfunc_st, CUmod_st, CUresult, CUstream_st};
  |                   ^^^^^^^^  ^^^^^^^^               ^^^^^^^^^  ^^^^^^^^            ^^^^^^^^^^^

warning: unused imports: `ptr` and `sync::Mutex`
 --> zluda/src/impl/mod.rs:8:5
  |
8 |     ptr,
  |     ^^^
9 |     sync::Mutex,
  |     ^^^^^^^^^^^

warning: unused imports: `transmute_lifetime_mut` and `transmute_lifetime`
 --> zluda/src/impl/device.rs:1:13
  |
1 | use super::{transmute_lifetime, transmute_lifetime_mut, CUresult};
  |             ^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^

warning: unused imports: `ClDeviceIdPtr`, `ContextProperties`, and `DeviceType`
  --> zluda/src/impl/device.rs:10:16
   |
10 | use ocl_core::{ClDeviceIdPtr, ContextProperties, DeviceType};
   |                ^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^  ^^^^^^^^^^

warning: unused imports: `AtomicU32`, `Ordering`, `cmp`, `collections::HashSet`, and `ffi::c_void`
  --> zluda/src/impl/device.rs:13:5
   |
13 |     cmp,
   |     ^^^
14 |     collections::HashSet,
   |     ^^^^^^^^^^^^^^^^^^^^
15 |     ffi::c_void,
   |     ^^^^^^^^^^^
...
19 |     sync::atomic::{AtomicU32, Ordering},
   |                    ^^^^^^^^^  ^^^^^^^^

warning: unused import: `hipDevicePrimaryCtxGetState`
 --> zluda/src/impl/export_table.rs:2:19
  |
2 |     hipCtxCreate, hipDevicePrimaryCtxGetState, hipDevicePrimaryCtxRelease,
  |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::r#impl::os`
  --> zluda/src/impl/export_table.rs:10:5
   |
10 | use crate::r#impl::os;
   |     ^^^^^^^^^^^^^^^^^

warning: unused imports: `Decuda` and `device`
  --> zluda/src/impl/export_table.rs:16:13
   |
16 | use super::{device, module, Decuda, Encuda};
   |             ^^^^^^          ^^^^^^

warning: unused imports: `hipFuncAttribute`, `hipFuncGetAttributes`, `hipLaunchKernel`, and `hipModuleLaunchKernel`
 --> zluda/src/impl/function.rs:1:35
  |
1 | ...t, hipFuncAttribute, hipFuncGetAttribute, hipFuncGetAttributes, hipFunction_attribute, hipLaunchKernel, hipModuleLaunchKernel};
  |       ^^^^^^^^^^^^^^^^                       ^^^^^^^^^^^^^^^^^^^^                         ^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^

warning: unused imports: `CUresult`, `HasLivenessCookie`, and `LiveCheck`
 --> zluda/src/impl/function.rs:3:13
  |
3 | use super::{CUresult, HasLivenessCookie, LiveCheck};
  |             ^^^^^^^^  ^^^^^^^^^^^^^^^^^  ^^^^^^^^^

warning: unused import: `CUstream`
 --> zluda/src/impl/function.rs:4:53
  |
4 | use crate::cuda::{CUfunction, CUfunction_attribute, CUstream};
  |                                                     ^^^^^^^^

warning: unused imports: `c_uint` and `c_void`
 --> zluda/src/impl/function.rs:5:22
  |
5 | use ::std::os::raw::{c_uint, c_void};
  |                      ^^^^^^  ^^^^^^

warning: unused import: `mem`
 --> zluda/src/impl/function.rs:6:11
  |
6 | use std::{mem, ptr};
  |           ^^^

warning: unused import: `std::ops::Add`
 --> zluda/src/impl/module.rs:6:5
  |
6 | use std::ops::Add;
  |     ^^^^^^^^^^^^^

warning: unused import: `fs`
  --> zluda/src/impl/module.rs:10:16
   |
10 | use std::{env, fs, iter, mem, ptr, slice};
   |                ^^

warning: unused imports: `hipCtxGetCurrent`, `hipDeviceGetAttribute`, `hipDeviceGetName`, and `hipGetStreamDeviceId`
  --> zluda/src/impl/module.rs:13:5
   |
13 |     hipCtxGetCurrent, hipCtxGetDevice, hipDeviceGetAttribute, hipDeviceGetName, hipDeviceProp_t,
   |     ^^^^^^^^^^^^^^^^                   ^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^
14 |     hipError_t, hipGetDeviceProperties, hipGetStreamDeviceId, hipModuleLoadData,
   |                                         ^^^^^^^^^^^^^^^^^^^^

warning: unused imports: `hipMemcpy3DParms`, `hipMemcpy3D`, `hipPitchedPtr`, and `hipPos`
 --> zluda/src/impl/memory.rs:2:33
  |
2 |     hipDrvMemcpy3D, hipError_t, hipMemcpy3D, hipMemcpy3DParms, hipMemoryType, hipPitchedPtr,
  |                                 ^^^^^^^^^^^  ^^^^^^^^^^^^^^^^                 ^^^^^^^^^^^^^
3 |     hipPos, HIP_MEMCPY3D,
  |     ^^^^^^

warning: unused imports: `CUdeviceptr` and `CUresult`
 --> zluda/src/impl/memory.rs:8:30
  |
8 |     cuda::{CUDA_MEMCPY3D_st, CUdeviceptr, CUmemorytype, CUresult},
  |                              ^^^^^^^^^^^                ^^^^^^^^

warning: unused imports: `CStr` and `slice`
 --> zluda/src/impl/link.rs:2:19
  |
2 |     ffi::{c_void, CStr},
  |                   ^^^^
3 |     mem, ptr, slice,
  |               ^^^^^

error[E0423]: expected function, found type alias `hipError_t`
    --> zluda/src/cuda.rs:2191:31
     |
2191 |     *pStr = hipGetErrorString(hipError_t(e));
     |                               ^^^^^^^^^^
     |
     = note: can't use a type alias as a constructor

error[E0308]: mismatched types
    --> zluda/src/cuda.rs:2610:36
     |
2610 |     let err = unsafe { hipMemsetD8(dev_ptr, 0, bytesize) }.into();
     |                        ----------- ^^^^^^^ expected `hipDeviceptr_t`, found `*mut c_void`
     |                        |
     |                        arguments to this function are incorrect
     |
     = note:   expected struct `hipDeviceptr_t`
             found raw pointer `*mut c_void`
note: function defined here
    --> /home/guest/ZLUDA/ext/hip_runtime-sys/src/hip_runtime_api.rs:4864:12
     |
4864 |     pub fn hipMemsetD8(
     |            ^^^^^^^^^^^
help: try wrapping the expression in `hip_runtime_sys::hipDeviceptr_t`
     |
2610 |     let err = unsafe { hipMemsetD8(hip_runtime_sys::hipDeviceptr_t(dev_ptr), 0, bytesize) }.into();
     |                                    ++++++++++++++++++++++++++++++++       +

error[E0605]: non-primitive cast: `usize` as `hipDeviceptr_t`
    --> zluda/src/cuda.rs:2796:28
     |
2796 |     unsafe { hipMemcpyHtoD(dstDevice.0 as _, srcHost as _, ByteCount).into() }
     |                            ^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object

error[E0605]: non-primitive cast: `usize` as `hipDeviceptr_t`
    --> zluda/src/cuda.rs:2815:42
     |
2815 |     unsafe { hipMemcpyDtoH(dstHost as _, srcDevice.0 as _, ByteCount).into() }
     |                                          ^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object

error[E0605]: non-primitive cast: `usize` as `hipDeviceptr_t`
    --> zluda/src/cuda.rs:2937:24
     |
2937 |     hipMemcpyHtoDAsync(dstDevice.0 as _, srcHost as _, ByteCount, hStream as _).into()
     |                        ^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object

error[E0605]: non-primitive cast: `usize` as `hipDeviceptr_t`
    --> zluda/src/cuda.rs:3012:26
     |
3012 |     unsafe { hipMemsetD8(dstDevice.0 as _, uc, N).into() }
     |                          ^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object

error[E0605]: non-primitive cast: `usize` as `hipDeviceptr_t`
    --> zluda/src/cuda.rs:3040:27
     |
3040 |     unsafe { hipMemsetD32(dstDevice.0 as _, ui as _, N).into() }
     |                           ^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object

error[E0425]: cannot find function `hipStreamGetCtx` in this scope
    --> zluda/src/cuda.rs:3428:14
     |
3428 |     unsafe { hipStreamGetCtx(hStream as _, pctx as _) }.into()
     |              ^^^^^^^^^^^^^^^ not found in this scope

error[E0599]: no variant or associated item named `hipErrorInvalidValue` found for enum `Result` in the current scope
  --> zluda/src/impl/device.rs:64:28
   |
64 |         return hipError_t::hipErrorInvalidValue;
   |                            ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
  --> zluda/src/impl/device.rs:70:32
   |
70 |             return hipError_t::hipSuccess;
   |                                ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
  --> zluda/src/impl/device.rs:78:32
   |
78 |             return hipError_t::hipSuccess;
   |                                ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
  --> zluda/src/impl/device.rs:99:32
   |
99 |             return hipError_t::hipSuccess;
   |                                ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
   --> zluda/src/impl/device.rs:103:32
    |
103 |             return hipError_t::hipSuccess;
    |                                ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
   --> zluda/src/impl/device.rs:107:32
    |
107 |             return hipError_t::hipSuccess;
    |                                ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
   --> zluda/src/impl/device.rs:165:32
    |
165 |             return hipError_t::hipSuccess;
    |                                ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
   --> zluda/src/impl/device.rs:171:35
    |
171 |             if err != hipError_t::hipSuccess {
    |                                   ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
   --> zluda/src/impl/device.rs:175:32
    |
175 |             return hipError_t::hipSuccess;
    |                                ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
   --> zluda/src/impl/device.rs:180:35
    |
180 |             if err != hipError_t::hipSuccess {
    |                                   ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
   --> zluda/src/impl/device.rs:184:32
    |
184 |             return hipError_t::hipSuccess;
    |                                ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipErrorInvalidValue` found for enum `Result` in the current scope
   --> zluda/src/impl/device.rs:57:37
    |
57  |               _ => return hipError_t::hipErrorInvalidValue
    |                                       ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`
...
186 |           attrib => remap_attribute! {
    |  ___________________-
187 | |             attrib =>
188 | |             [MAX THREADS PER BLOCK],
189 | |             [MAX BLOCK DIM X],
...   |
306 | |             //[MEMORY POOLS SUPPORTED],
307 | |         },
    | |_________- in this macro invocation
    |
    = note: this error originates in the macro `remap_attribute` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no variant or associated item named `hipErrorInvalidValue` found for enum `Result` in the current scope
   --> zluda/src/impl/device.rs:334:32
    |
334 |         return Err(hipError_t::hipErrorInvalidValue);
    |                                ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
   --> zluda/src/impl/mod.rs:44:52
    |
44  |             if err != hip_runtime_sys::hipError_t::hipSuccess {
    |                                                    ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`
    |
   ::: zluda/src/impl/device.rs:337:5
    |
337 |     hip_call! { hipGetDeviceProperties(&mut hip_props, dev.0) };
    |     ----------------------------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `hip_call` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
   --> zluda/src/impl/export_table.rs:149:27
    |
149 |     if err != hipError_t::hipSuccess {
    |                           ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
   --> zluda/src/impl/export_table.rs:153:27
    |
153 |     if err != hipError_t::hipSuccess {
    |                           ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
   --> zluda/src/impl/export_table.rs:157:17
    |
157 |     hipError_t::hipSuccess
    |                 ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipErrorInvalidValue` found for enum `Result` in the current scope
  --> zluda/src/impl/function.rs:14:28
   |
14 |         return hipError_t::hipErrorInvalidValue;
   |                            ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipErrorInvalidValue` found for enum `Result` in the current scope
  --> zluda/src/impl/function.rs:23:33
   |
23 |         _ => return hipError_t::hipErrorInvalidValue,
   |                                 ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipErrorInvalidImage` found for enum `Result` in the current scope
  --> zluda/src/impl/module.rs:33:38
   |
33 |             .map_err(|_| hipError_t::hipErrorInvalidImage)?;
   |                                      ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipErrorInvalidImage` found for enum `Result` in the current scope
  --> zluda/src/impl/module.rs:41:38
   |
41 |             .map_err(|_| hipError_t::hipErrorInvalidImage)?;
   |                                      ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipErrorInvalidImage` found for enum `Result` in the current scope
  --> zluda/src/impl/module.rs:43:36
   |
43 |             return Err(hipError_t::hipErrorInvalidImage);
   |                                    ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipErrorInvalidImage` found for enum `Result` in the current scope
  --> zluda/src/impl/module.rs:46:63
   |
46 |             ptx::to_spirv_module(ast).map_err(|_| hipError_t::hipErrorInvalidImage)?;
   |                                                               ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipErrorInvalidValue` found for enum `Result` in the current scope
  --> zluda/src/impl/module.rs:59:34
   |
59 |         .map_err(|_| hipError_t::hipErrorInvalidValue)?;
   |                                  ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipErrorFileNotFound` found for enum `Result` in the current scope
  --> zluda/src/impl/module.rs:60:66
   |
60 |     let mut file = File::open(file_name).map_err(|_| hipError_t::hipErrorFileNotFound)?;
   |                                                                  ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipErrorUnknown` found for enum `Result` in the current scope
  --> zluda/src/impl/module.rs:63:34
   |
63 |         .map_err(|_| hipError_t::hipErrorUnknown)?;
   |                                  ^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipErrorInvalidValue` found for enum `Result` in the current scope
  --> zluda/src/impl/module.rs:74:32
   |
74 |         return Err(hipError_t::hipErrorInvalidValue);
   |                                ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
  --> zluda/src/impl/module.rs:78:25
   |
78 |             hipError_t::hipSuccess => Ok(()),
   |                         ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
  --> zluda/src/impl/mod.rs:44:52
   |
44 |             if err != hip_runtime_sys::hipError_t::hipSuccess {
   |                                                    ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`
   |
  ::: zluda/src/impl/module.rs:88:5
   |
88 |     hip_call! { hipCtxGetDevice(&mut dev) };
   |     --------------------------------------- in this macro invocation
   |
   = note: this error originates in the macro `hip_call` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
  --> zluda/src/impl/mod.rs:44:52
   |
44 |             if err != hip_runtime_sys::hipError_t::hipSuccess {
   |                                                    ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`
   |
  ::: zluda/src/impl/module.rs:90:5
   |
90 |     hip_call! { hipGetDeviceProperties(&mut props, dev) };
   |     ----------------------------------------------------- in this macro invocation
   |
   = note: this error originates in the macro `hip_call` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no variant or associated item named `hipErrorUnknown` found for enum `Result` in the current scope
  --> zluda/src/impl/module.rs:96:30
   |
96 |     .map_err(|_| hipError_t::hipErrorUnknown)?;
   |                              ^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
  --> zluda/src/impl/mod.rs:44:52
   |
44 |             if err != hip_runtime_sys::hipError_t::hipSuccess {
   |                                                    ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`
   |
  ::: zluda/src/impl/module.rs:97:5
   |
97 |     hip_call! { hipModuleLoadData(pmod as _, arch_binary.as_ptr() as _) };
   |     --------------------------------------------------------------------- in this macro invocation
   |
   = note: this error originates in the macro `hip_call` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no variant or associated item named `hipErrorInvalidValue` found for enum `Result` in the current scope
  --> zluda/src/impl/memory.rs:15:32
   |
15 |         return Err(hipError_t::hipErrorInvalidValue);
   |                                ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0308]: mismatched types
  --> zluda/src/impl/memory.rs:19:22
   |
19 |         srcXInBytes: cu_copy.srcXInBytes as u32,
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32`

error[E0308]: mismatched types
  --> zluda/src/impl/memory.rs:20:15
   |
20 |         srcY: cu_copy.srcY as u32,
   |               ^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32`

error[E0308]: mismatched types
  --> zluda/src/impl/memory.rs:21:15
   |
21 |         srcZ: cu_copy.srcZ as u32,
   |               ^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32`

error[E0308]: mismatched types
  --> zluda/src/impl/memory.rs:22:17
   |
22 |         srcLOD: cu_copy.srcLOD as u32,
   |                 ^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32`

error[E0308]: mismatched types
  --> zluda/src/impl/memory.rs:27:19
   |
27 |         srcPitch: cu_copy.srcPitch as u32,
   |                   ^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32`

error[E0308]: mismatched types
  --> zluda/src/impl/memory.rs:28:20
   |
28 |         srcHeight: cu_copy.srcHeight as u32,
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32`

error[E0308]: mismatched types
  --> zluda/src/impl/memory.rs:29:22
   |
29 |         dstXInBytes: cu_copy.dstXInBytes as u32,
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32`

error[E0308]: mismatched types
  --> zluda/src/impl/memory.rs:30:15
   |
30 |         dstY: cu_copy.dstY as u32,
   |               ^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32`

error[E0308]: mismatched types
  --> zluda/src/impl/memory.rs:31:15
   |
31 |         dstZ: cu_copy.dstZ as u32,
   |               ^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32`

error[E0308]: mismatched types
  --> zluda/src/impl/memory.rs:32:17
   |
32 |         dstLOD: cu_copy.dstLOD as u32,
   |                 ^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32`

error[E0308]: mismatched types
  --> zluda/src/impl/memory.rs:37:19
   |
37 |         dstPitch: cu_copy.dstPitch as u32,
   |                   ^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32`

error[E0308]: mismatched types
  --> zluda/src/impl/memory.rs:38:20
   |
38 |         dstHeight: cu_copy.dstHeight as u32,
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32`

error[E0308]: mismatched types
  --> zluda/src/impl/memory.rs:39:23
   |
39 |         WidthInBytes: cu_copy.WidthInBytes as u32,
   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32`

error[E0308]: mismatched types
  --> zluda/src/impl/memory.rs:40:17
   |
40 |         Height: cu_copy.Height as u32,
   |                 ^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32`

error[E0308]: mismatched types
  --> zluda/src/impl/memory.rs:41:16
   |
41 |         Depth: cu_copy.Depth as u32,
   |                ^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
  --> zluda/src/impl/mod.rs:44:52
   |
44 |             if err != hip_runtime_sys::hipError_t::hipSuccess {
   |                                                    ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`
   |
  ::: zluda/src/impl/memory.rs:43:5
   |
43 |     hip_call! { hipDrvMemcpy3D(&hip_copy) };
   |     --------------------------------------- in this macro invocation
   |
   = note: this error originates in the macro `hip_call` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0605]: non-primitive cast: `usize` as `hipDeviceptr_t`
  --> zluda/src/impl/memory.rs:25:20
   |
25 |         srcDevice: cu_copy.srcDevice.0 as _,
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object

error[E0605]: non-primitive cast: `usize` as `hipDeviceptr_t`
  --> zluda/src/impl/memory.rs:35:20
   |
35 |         dstDevice: cu_copy.dstDevice.0 as _,
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object

error[E0599]: no variant or associated item named `hipErrorInvalidValue` found for enum `Result` in the current scope
  --> zluda/src/impl/memory.rs:53:30
   |
53 |         _ => Err(hipError_t::hipErrorInvalidValue),
   |                              ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipErrorInvalidValue` found for enum `Result` in the current scope
  --> zluda/src/impl/link.rs:48:32
   |
48 |         return Err(hipError_t::hipErrorInvalidValue);
   |                                ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
  --> zluda/src/impl/link.rs:54:32
   |
54 |         return Err(hipError_t::hipSuccess);
   |                                ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
  --> zluda/src/impl/mod.rs:44:52
   |
44 |             if err != hip_runtime_sys::hipError_t::hipSuccess {
   |                                                    ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`
   |
  ::: zluda/src/impl/link.rs:67:5
   |
67 |     hip_call! { hipCtxGetDevice(&mut dev) };
   |     --------------------------------------- in this macro invocation
   |
   = note: this error originates in the macro `hip_call` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
  --> zluda/src/impl/mod.rs:44:52
   |
44 |             if err != hip_runtime_sys::hipError_t::hipSuccess {
   |                                                    ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`
   |
  ::: zluda/src/impl/link.rs:69:5
   |
69 |     hip_call! { hipGetDeviceProperties(&mut props, dev) };
   |     ----------------------------------------------------- in this macro invocation
   |
   = note: this error originates in the macro `hip_call` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no variant or associated item named `hipErrorUnknown` found for enum `Result` in the current scope
  --> zluda/src/impl/link.rs:74:34
   |
74 |         .map_err(|_| hipError_t::hipErrorUnknown)?;
   |                                  ^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipErrorInvalidValue` found for enum `Result` in the current scope
  --> zluda/src/impl/pointer.rs:16:32
   |
16 |         return Err(hipError_t::hipErrorInvalidValue);
   |                                ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipSuccess` found for enum `Result` in the current scope
  --> zluda/src/impl/mod.rs:44:52
   |
44 |             if err != hip_runtime_sys::hipError_t::hipSuccess {
   |                                                    ^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`
   |
  ::: zluda/src/impl/pointer.rs:19:5
   |
19 |     hip_call! { hipPointerGetAttributes(&mut attribs, ptr.0 as _) };
   |     --------------------------------------------------------------- in this macro invocation
   |
   = note: this error originates in the macro `hip_call` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0609]: no field `memoryType` on type `hipPointerAttribute_t`
  --> zluda/src/impl/pointer.rs:26:53
   |
26 |             *(data as *mut _) = memory_type(attribs.memoryType)?;
   |                                                     ^^^^^^^^^^ unknown field
   |
   = note: available fields are: `type_`, `device`, `devicePointer`, `hostPointer`, `isManaged`, `allocationFlags`

error[E0599]: no variant or associated item named `hipErrorNotSupported` found for enum `Result` in the current scope
  --> zluda/src/impl/pointer.rs:41:30
   |
41 |         _ => Err(hipError_t::hipErrorNotSupported),
   |                              ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipErrorInvalidValue` found for enum `Result` in the current scope
  --> zluda/src/impl/pointer.rs:51:30
   |
51 |         _ => Err(hipError_t::hipErrorInvalidValue),
   |                              ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipErrorRuntimeMemory` found for enum `Result` in the current scope
   --> zluda/src/impl/mod.rs:167:42
    |
167 |             hip_runtime_sys::hipError_t::hipErrorRuntimeMemory
    |                                          ^^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

error[E0599]: no variant or associated item named `hipErrorRuntimeOther` found for enum `Result` in the current scope
   --> zluda/src/impl/mod.rs:168:44
    |
168 |             | hip_runtime_sys::hipError_t::hipErrorRuntimeOther => CUresult::CUDA_ERROR_UNKNOWN,
    |                                            ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Result<(), hipErrorCode_t>`

warning: unused variable: `dtor_cb`
   --> zluda/src/impl/export_table.rs:421:5
    |
421 |     dtor_cb: Option<
    |     ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_dtor_cb`
    |
    = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `halloc_ptr`
   --> zluda/src/impl/export_table.rs:527:5
    |
527 |     halloc_ptr: *mut *const HeapAllocRecord,
    |     ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_halloc_ptr`

warning: unused variable: `arg1`
   --> zluda/src/impl/export_table.rs:528:5
    |
528 |     arg1: usize,
    |     ^^^^ help: if this is intentional, prefix it with an underscore: `_arg1`

warning: unused variable: `arg2`
   --> zluda/src/impl/export_table.rs:529:5
    |
529 |     arg2: usize,
    |     ^^^^ help: if this is intentional, prefix it with an underscore: `_arg2`

warning: unused variable: `halloc`
   --> zluda/src/impl/export_table.rs:535:37
    |
535 | unsafe extern "system" fn heap_free(halloc: *mut HeapAllocRecord, arg1: *mut usize) -> CUresult {
    |                                     ^^^^^^ help: if this is intentional, prefix it with an underscore: `_halloc`

warning: unused variable: `arg1`
   --> zluda/src/impl/export_table.rs:535:67
    |
535 | unsafe extern "system" fn heap_free(halloc: *mut HeapAllocRecord, arg1: *mut usize) -> CUresult {
    |                                                                   ^^^^ help: if this is intentional, prefix it with an underscore: `_arg1`

warning: unused variable: `value`
  --> zluda/src/impl/context.rs:18:41
   |
18 | pub(crate) fn set_limit(limit: CUlimit, value: usize) -> CUresult {
   |                                         ^^^^^ help: if this is intentional, prefix it with an underscore: `_value`

warning: unused variable: `num_options`
  --> zluda/src/impl/link.rs:21:5
   |
21 |     num_options: u32,
   |     ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_num_options`

warning: unused variable: `options`
  --> zluda/src/impl/link.rs:22:5
   |
22 |     options: *mut CUjit_option,
   |     ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_options`

warning: unused variable: `option_values`
  --> zluda/src/impl/link.rs:23:5
   |
23 |     option_values: *mut *mut c_void,
   |     ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_option_values`

warning: unused variable: `state`
  --> zluda/src/impl/link.rs:84:9
   |
84 |     let state: Box<LinkState> = mem::transmute(state);
   |         ^^^^^ help: if this is intentional, prefix it with an underscore: `_state`

Some errors have detailed explanations: E0308, E0423, E0425, E0432, E0532, E0599, E0605, E0609.
For more information about an error, try `rustc --explain E0308`.
warning: `zluda` (lib) generated 31 warnings
error: could not compile `zluda` (lib) due to 76 previous errors; 31 warnings emitted
warning: build failed, waiting for other jobs to finish...
warning: `ptx` (lib) generated 410 warnings (run `cargo fix --lib -p ptx` to apply 15 suggestions)

@vosen
Copy link
Owner

vosen commented Oct 16, 2024

This is expected right now. ZLUDA is being rebuilt in bottom-up direction. Lower level subprojects (ptx, ptx_parser) were completely redone and the changes were not applied to higher level subprojects.

When you start seing automated builds on GitHub that means the whole project builds (and is minimally useful)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants