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

Compile errors from hip/hip_fp16.h inclusion #515

Closed
linehill opened this issue Jun 19, 2023 · 0 comments · Fixed by #592
Closed

Compile errors from hip/hip_fp16.h inclusion #515

linehill opened this issue Jun 19, 2023 · 0 comments · Fixed by #592
Assignees
Labels
bug Something isn't working

Comments

@linehill
Copy link
Collaborator

A case discovered from HeCBench/logprob-hip. Reduced case:

$ cat include-hip-fp16.hip
#include <hip/hip_fp16.h>
#include <hip/hip_runtime.h>
$ ../install/bin/hipcc include-hip-fp16.hip -c
In file included from include-hip-fp16.hip:1:
In file included from /mnt/md1/linehill/ws-chip-spv-2/install/include/hip/hip_fp16.h:41:
/mnt/md1/linehill/ws-chip-spv-2/install/include/hip/spirv_hip_fp16.h:35:2: error: Include this file after including hip/hip_runtime.h
#error Include this file after including hip/hip_runtime.h
 ^
In file included from include-hip-fp16.hip:2:
In file included from /mnt/md1/linehill/ws-chip-spv-2/install/include/hip/hip_runtime.h:73:
In file included from /mnt/md1/linehill/ws-chip-spv-2/install/include/hip/spirv_hip_runtime.h:46:
/mnt/md1/linehill/ws-chip-spv-2/install/include/hip/spirv_math_fwd.h:77:48: error: expected ')'
    __device__ __attribute__((const)) _Float16 __llvm_amdgcn_rcp_f16(_Float16);
                                               ^
/mnt/md1/linehill/ws-chip-spv-2/install/include/hip/spirv_hip_fp16.h:30:45: note: expanded from macro '__llvm_amdgcn_rcp_f16'
#define __llvm_amdgcn_rcp_f16(__X) ((__half)1.0f / (__half)__X)
                                            ^
/mnt/md1/linehill/ws-chip-spv-2/install/include/hip/spirv_math_fwd.h:77:48: note: to match this '('
/mnt/md1/linehill/ws-chip-spv-2/install/include/hip/spirv_hip_fp16.h:30:36: note: expanded from macro '__llvm_amdgcn_rcp_f16'
#define __llvm_amdgcn_rcp_f16(__X) ((__half)1.0f / (__half)__X)
                                   ^
In file included from include-hip-fp16.hip:2:
In file included from /mnt/md1/linehill/ws-chip-spv-2/install/include/hip/hip_runtime.h:73:
In file included from /mnt/md1/linehill/ws-chip-spv-2/install/include/hip/spirv_hip_runtime.h:46:
/mnt/md1/linehill/ws-chip-spv-2/install/include/hip/spirv_math_fwd.h:233:12: error: expected ')'
    __2f16 __llvm_amdgcn_rcp_2f16(__2f16 x) // Not currently exposed by ROCDL.
           ^
/mnt/md1/linehill/ws-chip-spv-2/install/include/hip/spirv_hip_fp16.h:31:47: note: expanded from macro '__llvm_amdgcn_rcp_2f16'
#define __llvm_amdgcn_rcp_2f16(__X) ((__half2)1.0f / (__half2)__X)
                                              ^
/mnt/md1/linehill/ws-chip-spv-2/install/include/hip/spirv_math_fwd.h:233:12: note: to match this '('
/mnt/md1/linehill/ws-chip-spv-2/install/include/hip/spirv_hip_fp16.h:31:37: note: expanded from macro '__llvm_amdgcn_rcp_2f16'
#define __llvm_amdgcn_rcp_2f16(__X) ((__half2)1.0f / (__half2)__X)
                                    ^
In file included from include-hip-fp16.hip:2:
In file included from /mnt/md1/linehill/ws-chip-spv-2/install/include/hip/hip_runtime.h:73:
In file included from /mnt/md1/linehill/ws-chip-spv-2/install/include/hip/spirv_hip_runtime.h:46:
/mnt/md1/linehill/ws-chip-spv-2/install/include/hip/spirv_math_fwd.h:235:9: error: expected expression
        return __2f16{__llvm_amdgcn_rcp_f16(x.x), __llvm_amdgcn_rcp_f16(x.y)};
        ^
/mnt/md1/linehill/ws-chip-spv-2/install/include/hip/spirv_math_fwd.h:236:6: error: expected ';' after top level declarator
    }
     ^
5 errors generated when compiling for .

failed to execute:/mnt/md1/linehill/ws-chip-spv-2/install/bin/clang++ -x hip include-hip-fp16.hip -D__HIP_PLATFORM_SPIRV__= --offload=spirv64 -Xclang -no-opaque-pointers -nohipwrapperinc --hip-path=/mnt/md1/linehill/ws-chip-spv-2/install --target=x86_64-unknown-linux-gnu -include /mnt/md1/linehill/ws-chip-spv-2/install/include/hip/spirv_fixups.h -I//mnt/md1/linehill/ws-chip-spv-2/install/include   -c
@linehill linehill added the bug Something isn't working label Jun 19, 2023
@pvelesko pvelesko self-assigned this Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants