public class Configuration
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TRANSLATOR |
Modifier and Type | Method and Description |
---|---|
protected void |
checkVersion(java.lang.String configVersion)
Check whether the configuration file version is high enough with the
compiler version.
|
void |
displayConfig()
Display the loaded configuration.
|
static Configuration |
get()
Get the unique instance.
|
CompilerDirective |
getCurrentDirective()
Get the current directive directive defined in the configuration.
|
Target |
getCurrentTarget()
Get the current target defined in the configuration or by the user on
the command line.
|
java.util.List<GroupConfiguration> |
getGroups()
Get all the group configuration information.
|
protected int[] |
getMajorMinor(java.lang.String version)
Extract major and minor version number from the full version String.
|
int |
getMaxColumns()
Get the defined max column parameter.
|
java.lang.String |
getParameter(java.lang.String key)
Get value of a parameter.
|
void |
init(CompilerDirective dir,
Target target)
Constructs basic configuration object.
|
boolean |
isForcePure()
Check whether the force pure option is enabled or not.
|
void |
load(java.lang.String configPath,
java.lang.String userConfigFile)
Constructs a new configuration object from the give configuration file.
|
OpenAccConfiguration |
openACC()
Get the OpenACC specific configuration information.
|
void |
setForcePure()
Enable the force pure option.
|
void |
setMaxColumns(int value)
Set the max column value.
|
void |
setUserDefineDirective(java.lang.String option)
Set the user defined directive in the configuration.
|
void |
setUserDefinedTarget(java.lang.String option)
Set the user defined target in the configuration.
|
public static final java.lang.String TRANSLATOR
public static Configuration get()
public void init(CompilerDirective dir, Target target)
dir
- Accelerator directive language.target
- Target architecture.public void load(java.lang.String configPath, java.lang.String userConfigFile) throws java.lang.Exception
configPath
- Path to the configuration files and XSD schemas.userConfigFile
- Path to the alternative configuration.java.lang.Exception
- If configuration cannot be loaded properly.public java.lang.String getParameter(java.lang.String key)
key
- Key of the parameter.public OpenAccConfiguration openACC()
public java.util.List<GroupConfiguration> getGroups()
public CompilerDirective getCurrentDirective()
public Target getCurrentTarget()
public void setUserDefinedTarget(java.lang.String option)
option
- Option passed as argument. Has priority over configuration
file.public void setUserDefineDirective(java.lang.String option)
option
- Option passed as argument. Has priority over configuration
file.public void setForcePure()
public boolean isForcePure()
protected void checkVersion(java.lang.String configVersion) throws java.lang.Exception
configVersion
- Version string from the configuration file.java.lang.Exception
- If the configuration version is not high enough.protected int[] getMajorMinor(java.lang.String version) throws java.lang.Exception
version
- Full version String. Format: major.minor.fixesjava.lang.Exception
- If the version String is not of the correct format.public int getMaxColumns()
public void setMaxColumns(int value)
value
- New value of the max column parameter.public void displayConfig()