-
Notifications
You must be signed in to change notification settings - Fork 745
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Allow specification of double GRF mode for SYCL (#6914)
This change extends Konst's work from #6182 to work for any SYCL kernel, not just ESIMD kernels Basic summary of changes: 1) Move SYCL library set_kernel_properties function and related detail header out of esimd code into generic SYCL code 2) Generalize SYCLLowerESIMDKernelPropsPass to make it work for SYCL kernels 3) Change sycl-post-link module splitting to split non-ESIMD modules that have any number of double GRF kernels 4) Change program loader to add the "-ze-opt-large-register-file" option if the double GRF property is set. We do this instead of -doubleGRF because -doubleGRF only works for the VC backend, while -ze-opt-large-register-file works for both VC and scalar backends Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
- Loading branch information
Showing
23 changed files
with
323 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//===---- LowerKernelProps.h - lower kernel properties -----------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// Lowers SYCL kernel properties into attributes used by sycl-post-link | ||
//===----------------------------------------------------------------------===// | ||
|
||
#pragma once | ||
|
||
#include "llvm/IR/PassManager.h" | ||
|
||
namespace sycl { | ||
namespace kernel_props { | ||
constexpr char ATTR_DOUBLE_GRF[] = "double-grf"; | ||
} | ||
} // namespace sycl | ||
namespace llvm { | ||
// Lowers calls to __sycl_set_kernel_properties | ||
class SYCLLowerKernelPropsPass | ||
: public PassInfoMixin<SYCLLowerKernelPropsPass> { | ||
public: | ||
PreservedAnalyses run(Module &M, ModuleAnalysisManager &); | ||
}; | ||
} // namespace llvm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
//===------------ SYCLUtils.h - SYCL utility functions | ||
//------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// Utility functions for SYCL. | ||
//===----------------------------------------------------------------------===// | ||
#pragma once | ||
|
||
#include "llvm/ADT/SmallPtrSet.h" | ||
#include "llvm/IR/Function.h" | ||
|
||
#include <functional> | ||
namespace llvm { | ||
namespace sycl { | ||
namespace utils { | ||
using CallGraphNodeAction = std::function<void(Function *)>; | ||
|
||
// Traverses call graph starting from given function up the call chain applying | ||
// given action to each function met on the way. If \c ErrorOnNonCallUse | ||
// parameter is true, then no functions' uses are allowed except calls. | ||
// Otherwise, any function where use of the current one happened is added to the | ||
// call graph as if the use was a call. | ||
// Functions which are part of the visited set ('Visited' parameter) are not | ||
// traversed. | ||
void traverseCallgraphUp(llvm::Function *F, CallGraphNodeAction NodeF, | ||
SmallPtrSetImpl<Function *> &Visited, | ||
bool ErrorOnNonCallUse); | ||
|
||
template <class CallGraphNodeActionF> | ||
void traverseCallgraphUp(Function *F, CallGraphNodeActionF ActionF, | ||
SmallPtrSetImpl<Function *> &Visited, | ||
bool ErrorOnNonCallUse) { | ||
traverseCallgraphUp(F, CallGraphNodeAction(ActionF), Visited, | ||
ErrorOnNonCallUse); | ||
} | ||
|
||
template <class CallGraphNodeActionF> | ||
void traverseCallgraphUp(Function *F, CallGraphNodeActionF ActionF, | ||
bool ErrorOnNonCallUse = true) { | ||
SmallPtrSet<Function *, 32> Visited; | ||
traverseCallgraphUp(F, CallGraphNodeAction(ActionF), Visited, | ||
ErrorOnNonCallUse); | ||
} | ||
} // namespace utils | ||
} // namespace sycl | ||
} // namespace llvm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.