Skip to content

Commit

Permalink
Merge branch 'clang-format-attribs' into 'develop_stream'
Browse files Browse the repository at this point in the history
clang-format: trick clang-format into always breaking after c-style function attributes

See merge request amd/libraries/rocPRIM!698
  • Loading branch information
Snektron authored and Naraenda committed Jul 18, 2024
2 parents fc2de52 + c9a1335 commit 9c7c297
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros: ['ROCPRIM_DEVICE', 'ROCPRIM_HOST', 'ROCPRIM_HOST_DEVICE', 'ROCPRIM_SHARED_MEMORY', 'ROCPRIM_KERNEL', 'ROCPRIM_INLINE']
BinPackArguments: false
BinPackParameters: false
BitFieldColonSpacing: Both
Expand Down Expand Up @@ -135,4 +134,38 @@ SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false

AttributeMacros:
- __host__
- __device__
- __global__
- __forceinline__
- __shared__
- __launch_bounds__
- ROCPRIM_DEVICE
- ROCPRIM_HOST
- ROCPRIM_HOST_DEVICE
- ROCPRIM_SHARED_MEMORY
- ROCPRIM_KERNEL
- ROCPRIM_INLINE
- ROCPRIM_FORCE_INLINE

# Trick clang into thinking that our C-style attributes are C++-style attributes
# Make sure that the sizes line up for linebreaks etc
Macros:
- __host__=[[host]]
- __device__=[[device]]
- __global__=[[global]]
- __forceinline__=[[forceinline]]
- __shared__=[[shared]]
- __launch_bounds__(x)=[[launch_bounds(x)]]
- __attribute__(x)=[[attribute(x)]]
- ROCPRIM_DEVICE=[[DEVICE____]]
- ROCPRIM_HOST=[[HOST____]]
- ROCPRIM_HOST_DEVICE=[[HOST_DEVICE____]]
- ROCPRIM_SHARED_MEMORY=[[SHARED_MEMORY____]]
- ROCPRIM_KERNEL=[[KERNEL____]]
- ROCPRIM_INLINE=[[INLINE____]]
- ROCPRIM_FORCE_INLINE=[FORCE_INLINE____]]
BreakAfterAttributes: Always
---

0 comments on commit 9c7c297

Please sign in to comment.