Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
scan/reduce updates
Browse files Browse the repository at this point in the history
Change-Id: Ic53def1aec575e4a05f8be1b492a4df574763a46
  • Loading branch information
b-sumner committed Jun 13, 2018
1 parent 4a0848c commit a23be48
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 166 deletions.
3 changes: 3 additions & 0 deletions irif/inc/irif.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ extern uint __llvm_amdgcn_ds_swizzle(uint, uint) __asm("llvm.amdgcn.ds.swizzle")
// llvm.amdgcn.mov.dpp.i32 <src> <dpp_ctrl> <row_mask> <bank_mask> <bound_ctrl>
extern uint __llvm_amdgcn_mov_dpp_i32(uint, uint, uint, uint, bool) __asm("llvm.amdgcn.mov.dpp.i32");

// llvm.amdgcn.update.dpp.i32 <old> <src> <dpp_ctrl> <row_mask> <bank_mask> <bound_ctrl>
extern uint __llvm_amdgcn_update_dpp_i32(uint, uint, uint, uint, uint, bool) __asm("llvm.amdgcn.update.dpp.i32");

// Operand bits: [0..3]=VM_CNT, [4..6]=EXP_CNT (Export), [8..11]=LGKM_CNT (LDS, GDS, Konstant, Message)
extern void __llvm_amdgcn_s_waitcnt(int) __asm("llvm.amdgcn.s.waitcnt");

Expand Down
1 change: 1 addition & 0 deletions ockl/inc/ockl.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ DECL_CONST_OCKL_BINARY_U64(mul_hi)
DECL_CONST_OCKL_BINARY_I32(mul24)
DECL_CONST_OCKL_BINARY_U32(mul24)

DECL_OCKL_NULLARY_U32(lane)
DECL_OCKL_NULLARY_U32(activelane)


Expand Down
16 changes: 16 additions & 0 deletions ockl/src/lane.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*===--------------------------------------------------------------------------
* ROCm Device Libraries
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
*===------------------------------------------------------------------------*/

#include "irif.h"
#include "ockl.h"

__attribute__((always_inline)) uint
OCKL_MANGLE_U32(lane)(void)
{
return __llvm_amdgcn_mbcnt_hi(~0u, __llvm_amdgcn_mbcnt_lo(~0u, 0u));
}

Loading

0 comments on commit a23be48

Please sign in to comment.