Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,16 @@ set_property(CACHE YAML_BACKEND PROPERTY STRINGS YAML_CPP LLVM)
# For paths given when reporting errors
add_compile_options(-fmacro-prefix-map=${PROJECT_SOURCE_DIR}=.)

set(EXTRA_LINK_OPTIONS "-Wl,--exclude-libs,ALL")

if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(COROUTINES_COMPILE_OPTION)
set(EXTRA_COMPILE_OPTIONS)
set(EXTRA_LINK_OPTIONS -fuse-ld=lld -frtti)
list(PREPEND EXTRA_LINK_OPTIONS -fuse-ld=lld -frtti)
else()
set(COROUTINES_COMPILE_OPTION -fcoroutines)
set(EXTRA_COMPILE_OPTIONS)
set(EXTRA_LINK_OPTIONS -frtti)
list(PREPEND EXTRA_LINK_OPTIONS -frtti)
endif()

if(ROCROLLER_ENABLE_TIMERS)
Expand Down
2 changes: 2 additions & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ set_target_properties(
rocroller PROPERTIES
VERSION ${ROCROLLER_VERSION}
SOVERSION ${ROCROLLER_SOVERSION}
VISIBILITY_INLINES_HIDDEN ON
CXX_VISIBILITY_PRESET hidden
)

target_link_libraries(rocroller
Expand Down
6 changes: 4 additions & 2 deletions lib/include/rocRoller/Assemblers/Assembler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

#pragma once

#include <rocRoller/rocRoller.hpp>

#include <memory>
#include <string>
#include <vector>
Expand All @@ -35,9 +37,9 @@

namespace rocRoller
{
std::ostream& operator<<(std::ostream&, AssemblerType);
ROCROLLER_DECLSPEC std::ostream& operator<<(std::ostream&, AssemblerType);

class Assembler
class ROCROLLER_DECLSPEC Assembler
{
public:
using Argument = AssemblerType;
Expand Down
6 changes: 4 additions & 2 deletions lib/include/rocRoller/Assemblers/Assembler_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@

#pragma once

#include <rocRoller/rocRoller.hpp>

#include <memory>
#include <string>

namespace rocRoller
{
class Assembler;
class ROCROLLER_DECLSPEC Assembler;
using AssemblerPtr = std::shared_ptr<Assembler>;

enum class AssemblerType : int
Expand All @@ -41,5 +43,5 @@ namespace rocRoller
Count
};

std::string toString(AssemblerType t);
ROCROLLER_DECLSPEC std::string toString(AssemblerType t);
}
4 changes: 3 additions & 1 deletion lib/include/rocRoller/Assemblers/InProcessAssembler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@

#pragma once

#include <rocRoller/rocRoller.hpp>

#include <rocRoller/Assemblers/Assembler.hpp>
#include <rocRoller/GPUArchitecture/GPUArchitectureTarget.hpp>

#include <vector>

namespace rocRoller
{
class InProcessAssembler : public Assembler
class ROCROLLER_DECLSPEC InProcessAssembler : public Assembler
{
public:
InProcessAssembler();
Expand Down
4 changes: 3 additions & 1 deletion lib/include/rocRoller/Assemblers/SubprocessAssembler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

#pragma once

#include <rocRoller/rocRoller.hpp>

#include <rocRoller/Assemblers/Assembler.hpp>
#include <rocRoller/GPUArchitecture/GPUArchitectureTarget.hpp>

Expand All @@ -34,7 +36,7 @@

namespace rocRoller
{
class SubprocessAssembler : public Assembler
class ROCROLLER_DECLSPEC SubprocessAssembler : public Assembler
{
public:
SubprocessAssembler();
Expand Down
6 changes: 4 additions & 2 deletions lib/include/rocRoller/AssemblyKernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

#pragma once

#include <rocRoller/rocRoller.hpp>

#include <memory>
#include <string>
#include <unordered_map>
Expand All @@ -43,7 +45,7 @@

namespace rocRoller
{
class AssemblyKernel
class ROCROLLER_DECLSPEC AssemblyKernel
{
public:
AssemblyKernel(ContextPtr context, std::string const& kernelName);
Expand Down Expand Up @@ -231,7 +233,7 @@ namespace rocRoller
CommandPtr m_command;
};

struct AssemblyKernels
struct ROCROLLER_DECLSPEC AssemblyKernels
{
constexpr std::array<int, 2> hsa_version()
{
Expand Down
7 changes: 5 additions & 2 deletions lib/include/rocRoller/AssemblyKernelArgument.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@

#pragma once

#include <rocRoller/rocRoller.hpp>

#include <string>

#include <rocRoller/Expression.hpp>

namespace rocRoller
{

struct AssemblyKernelArgument
struct ROCROLLER_DECLSPEC AssemblyKernelArgument
{
std::string name;
VariableType variableType;
Expand All @@ -52,5 +54,6 @@ namespace rocRoller
std::string toString() const;
};

std::ostream& operator<<(std::ostream& stream, AssemblyKernelArgument const& arg);
ROCROLLER_DECLSPEC std::ostream& operator<<(std::ostream& stream,
AssemblyKernelArgument const& arg);
}
4 changes: 3 additions & 1 deletion lib/include/rocRoller/AssemblyKernelArgument_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@

#pragma once

#include <rocRoller/rocRoller.hpp>

#include <memory>

namespace rocRoller
{
struct AssemblyKernelArgument;
struct ROCROLLER_DECLSPEC AssemblyKernelArgument;

using AssemblyKernelArgumentPtr = std::shared_ptr<AssemblyKernelArgument>;
}
4 changes: 3 additions & 1 deletion lib/include/rocRoller/AssemblyKernel_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@

#pragma once

#include <rocRoller/rocRoller.hpp>

#include <memory>

namespace rocRoller
{
class AssemblyKernel;
class ROCROLLER_DECLSPEC AssemblyKernel;
using AssemblyKernelPtr = std::shared_ptr<AssemblyKernel>;
}
6 changes: 4 additions & 2 deletions lib/include/rocRoller/AssertOpKinds.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@

#pragma once

#include <rocRoller/rocRoller.hpp>

#include <string>

#include <rocRoller/AssertOpKinds_fwd.hpp>

namespace rocRoller
{

std::string toString(const AssertOpKind& assertOpKind);
std::ostream& operator<<(std::ostream&, AssertOpKind const);
ROCROLLER_DECLSPEC std::string toString(AssertOpKind const& assertOpKind);
ROCROLLER_DECLSPEC std::ostream& operator<<(std::ostream&, AssertOpKind const);

}
6 changes: 4 additions & 2 deletions lib/include/rocRoller/CodeGen/Annotate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

#pragma once

#include <rocRoller/rocRoller.hpp>

#include <rocRoller/CodeGen/Instruction.hpp>
#include <rocRoller/Utilities/Generator.hpp>

Expand All @@ -40,7 +42,7 @@ namespace rocRoller
* This will add the comment "foo" to each instruction that's part of
* generating `expr`.
*/
class AddComment
class ROCROLLER_DECLSPEC AddComment
{
public:
AddComment(std::string comment)
Expand All @@ -63,7 +65,7 @@ namespace rocRoller
* Really intended for use only from LowerFromKernelGraph, so that every
* instruction is annotated with the control op that it came from.
*/
class AddControlOp
class ROCROLLER_DECLSPEC AddControlOp
{
public:
AddControlOp(int op)
Expand Down
6 changes: 4 additions & 2 deletions lib/include/rocRoller/CodeGen/ArgumentLoader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

#pragma once

#include <rocRoller/rocRoller.hpp>

#include <string>
#include <unordered_map>

Expand All @@ -40,7 +42,7 @@

namespace rocRollerTest
{
class ArgumentLoaderTest_loadArgExtra_Test;
class ROCROLLER_DECLSPEC ArgumentLoaderTest_loadArgExtra_Test;
}

namespace rocRoller
Expand All @@ -57,7 +59,7 @@ namespace rocRoller
* instructions as well as possibly more synchronization.
*
*/
class ArgumentLoader
class ROCROLLER_DECLSPEC ArgumentLoader
{
public:
ArgumentLoader(AssemblyKernelPtr kernel);
Expand Down
4 changes: 3 additions & 1 deletion lib/include/rocRoller/CodeGen/ArgumentLoader_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@

#pragma once

#include <rocRoller/rocRoller.hpp>

namespace rocRoller
{
class ArgumentLoader;
class ROCROLLER_DECLSPEC ArgumentLoader;

}
8 changes: 5 additions & 3 deletions lib/include/rocRoller/CodeGen/Arithmetic/Add.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,24 @@

#pragma once

#include <rocRoller/rocRoller.hpp>

#include <rocRoller/CodeGen/Arithmetic/ArithmeticGenerator.hpp>

namespace rocRoller
{

// GetGenerator function will return the Generator to use based on the provided arguments.
template <>
std::shared_ptr<BinaryArithmeticGenerator<Expression::Add>>
GetGenerator<Expression::Add>(Register::ValuePtr dst,
ROCROLLER_DECLSPEC std::shared_ptr<BinaryArithmeticGenerator<Expression::Add>>
GetGenerator<Expression::Add>(Register::ValuePtr dst,
Register::ValuePtr lhs,
Register::ValuePtr rhs,
Expression::Add const&);

// Templated Generator class based on the register type and datatype.
template <Register::Type REGISTER_TYPE, DataType DATATYPE>
class AddGenerator : public BinaryArithmeticGenerator<Expression::Add>
class ROCROLLER_DECLSPEC AddGenerator : public BinaryArithmeticGenerator<Expression::Add>
{
public:
AddGenerator(ContextPtr c)
Expand Down
9 changes: 6 additions & 3 deletions lib/include/rocRoller/CodeGen/Arithmetic/AddShiftL.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,25 @@

#pragma once

#include <rocRoller/rocRoller.hpp>

#include <rocRoller/CodeGen/Arithmetic/ArithmeticGenerator.hpp>

namespace rocRoller
{

// GetGenerator function will return the Generator to use based on the provided arguments.
template <>
std::shared_ptr<TernaryArithmeticGenerator<Expression::AddShiftL>>
GetGenerator<Expression::AddShiftL>(Register::ValuePtr dst,
ROCROLLER_DECLSPEC std::shared_ptr<TernaryArithmeticGenerator<Expression::AddShiftL>>
GetGenerator<Expression::AddShiftL>(Register::ValuePtr dst,
Register::ValuePtr lhs,
Register::ValuePtr rhs,
Register::ValuePtr shiftAmount,
Expression::AddShiftL const&);

// Generator for all register types and datatypes.
class AddShiftLGenerator : public TernaryArithmeticGenerator<Expression::AddShiftL>
class ROCROLLER_DECLSPEC AddShiftLGenerator
: public TernaryArithmeticGenerator<Expression::AddShiftL>
{
public:
AddShiftLGenerator(ContextPtr c)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

#pragma once

#include <rocRoller/rocRoller.hpp>

#include <rocRoller/CodeGen/Instruction.hpp>
#include <rocRoller/Utilities/Error.hpp>
#include <rocRoller/Utilities/Generator.hpp>
Expand All @@ -34,7 +36,7 @@ namespace rocRoller
{
/// Base Arithmetic Generator class. All Arithmetic generators should be derived
/// from this class.
class ArithmeticGenerator
class ROCROLLER_DECLSPEC ArithmeticGenerator
{
public:
ArithmeticGenerator(ContextPtr context)
Expand Down Expand Up @@ -101,7 +103,7 @@ namespace rocRoller
// Unary Arithmetic Generator. Most unary generators should be derived from
// this class.
template <Expression::CUnary Operation>
class UnaryArithmeticGenerator : public ArithmeticGenerator
class ROCROLLER_DECLSPEC UnaryArithmeticGenerator : public ArithmeticGenerator
{
public:
UnaryArithmeticGenerator(ContextPtr context)
Expand Down Expand Up @@ -129,7 +131,7 @@ namespace rocRoller
// Binary Arithmetic Generator. Most binary generators should be derived from
// this class.
template <Expression::CBinary Operation>
class BinaryArithmeticGenerator : public ArithmeticGenerator
class ROCROLLER_DECLSPEC BinaryArithmeticGenerator : public ArithmeticGenerator
{
public:
BinaryArithmeticGenerator(ContextPtr context)
Expand Down Expand Up @@ -160,7 +162,7 @@ namespace rocRoller
// Ternary Arithmetic Generator. Most ternary generators should be derived from
// this class.
template <Expression::CTernary Operation>
class TernaryArithmeticGenerator : public ArithmeticGenerator
class ROCROLLER_DECLSPEC TernaryArithmeticGenerator : public ArithmeticGenerator
{
public:
TernaryArithmeticGenerator(ContextPtr context)
Expand Down Expand Up @@ -192,7 +194,7 @@ namespace rocRoller
// TernaryMixed Arithmetic Generator. Only Ternary generators that can support mixed
// airthmetic should be derived from this class.
template <Expression::CTernaryMixed Operation>
class TernaryMixedArithmeticGenerator : public ArithmeticGenerator
class ROCROLLER_DECLSPEC TernaryMixedArithmeticGenerator : public ArithmeticGenerator
{
public:
TernaryMixedArithmeticGenerator(ContextPtr context)
Expand Down
Loading