Skip to content

Commit

Permalink
* Getters now return non-primitive member variables by const referenc…
Browse files Browse the repository at this point in the history
…e rather than by value across the entire KTT framework

* Header file include directives now use unified syntax
  • Loading branch information
Fillo7 committed Nov 11, 2018
1 parent 4a9f562 commit ff5f232
Show file tree
Hide file tree
Showing 122 changed files with 529 additions and 532 deletions.
8 changes: 4 additions & 4 deletions source/api/computation_result.cpp
@@ -1,4 +1,4 @@
#include "computation_result.h"
#include <api/computation_result.h>

namespace ktt
{
Expand Down Expand Up @@ -37,17 +37,17 @@ uint64_t ComputationResult::getDuration() const
return duration;
}

std::string ComputationResult::getKernelName() const
const std::string& ComputationResult::getKernelName() const
{
return kernelName;
}

std::string ComputationResult::getErrorMessage() const
const std::string& ComputationResult::getErrorMessage() const
{
return errorMessage;
}

std::vector<ParameterPair> ComputationResult::getConfiguration() const
const std::vector<ParameterPair>& ComputationResult::getConfiguration() const
{
return configuration;
}
Expand Down
16 changes: 8 additions & 8 deletions source/api/computation_result.h
Expand Up @@ -6,8 +6,8 @@
#include <cstdint>
#include <string>
#include <vector>
#include "ktt_platform.h"
#include "api/parameter_pair.h"
#include <api/parameter_pair.h>
#include <ktt_platform.h>

namespace ktt
{
Expand Down Expand Up @@ -52,23 +52,23 @@ class KTT_API ComputationResult
*/
uint64_t getDuration() const;

/** @fn std::string getKernelName() const
/** @fn const std::string& getKernelName() const
* Getter for kernel name.
* @return Kernel name.
*/
std::string getKernelName() const;
const std::string& getKernelName() const;

/** @fn std::string getErrorMessage() const
/** @fn const std::string& getErrorMessage() const
* Getter for error message.
* @return If status is true, empty string. If status is false, message containing information about computation failure.
*/
std::string getErrorMessage() const;
const std::string& getErrorMessage() const;

/** @fn std::vector<ParameterPair> getConfiguration() const
/** @fn const std::vector<ParameterPair>& getConfiguration() const
* Getter for tuning result configuration.
* @return Tuning result configuration.
*/
std::vector<ParameterPair> getConfiguration() const;
const std::vector<ParameterPair>& getConfiguration() const;

private:
bool status;
Expand Down
8 changes: 4 additions & 4 deletions source/api/device_info.cpp
@@ -1,4 +1,4 @@
#include "device_info.h"
#include <api/device_info.h>

namespace ktt
{
Expand All @@ -13,17 +13,17 @@ DeviceIndex DeviceInfo::getId() const
return id;
}

std::string DeviceInfo::getName() const
const std::string& DeviceInfo::getName() const
{
return name;
}

std::string DeviceInfo::getVendor() const
const std::string& DeviceInfo::getVendor() const
{
return vendor;
}

std::string DeviceInfo::getExtensions() const
const std::string& DeviceInfo::getExtensions() const
{
return extensions;
}
Expand Down
18 changes: 9 additions & 9 deletions source/api/device_info.h
Expand Up @@ -6,9 +6,9 @@
#include <cstdint>
#include <iostream>
#include <string>
#include "ktt_platform.h"
#include "ktt_types.h"
#include "enum/device_type.h"
#include <enum/device_type.h>
#include <ktt_platform.h>
#include <ktt_types.h>

namespace ktt
{
Expand All @@ -32,23 +32,23 @@ class KTT_API DeviceInfo
*/
DeviceIndex getId() const;

/** @fn std::string getName() const
/** @fn const std::string& getName() const
* Getter for name of device retrieved from compute API.
* @return Name of device retrieved from compute API.
*/
std::string getName() const;
const std::string& getName() const;

/** @fn std::string getVendor() const
/** @fn const std::string& getVendor() const
* Getter for name of device vendor retrieved from compute API.
* @return Name of device vendor retrieved from compute API.
*/
std::string getVendor() const;
const std::string& getVendor() const;

/** @fn std::string getExtensions() const
/** @fn const std::string& getExtensions() const
* Getter for list of supported device extensions retrieved from compute API.
* @return List of supported device extensions retrieved from compute API.
*/
std::string getExtensions() const;
const std::string& getExtensions() const;

/** @fn DeviceType getDeviceType() const
* Getter for type of device. See ::DeviceType for more information.
Expand Down
2 changes: 1 addition & 1 deletion source/api/dimension_vector.cpp
@@ -1,5 +1,5 @@
#include <stdexcept>
#include "dimension_vector.h"
#include <api/dimension_vector.h>

namespace ktt
{
Expand Down
6 changes: 3 additions & 3 deletions source/api/dimension_vector.h
Expand Up @@ -5,9 +5,9 @@

#include <iostream>
#include <vector>
#include "ktt_platform.h"
#include "enum/modifier_action.h"
#include "enum/modifier_dimension.h"
#include <enum/modifier_action.h>
#include <enum/modifier_dimension.h>
#include <ktt_platform.h>

namespace ktt
{
Expand Down
2 changes: 1 addition & 1 deletion source/api/output_descriptor.cpp
@@ -1,4 +1,4 @@
#include "output_descriptor.h"
#include <api/output_descriptor.h>

namespace ktt
{
Expand Down
4 changes: 2 additions & 2 deletions source/api/output_descriptor.h
Expand Up @@ -4,8 +4,8 @@
#pragma once

#include <cstddef>
#include "ktt_platform.h"
#include "ktt_types.h"
#include <ktt_platform.h>
#include <ktt_types.h>

namespace ktt
{
Expand Down
4 changes: 2 additions & 2 deletions source/api/parameter_pair.cpp
@@ -1,4 +1,4 @@
#include "parameter_pair.h"
#include <api/parameter_pair.h>

namespace ktt
{
Expand Down Expand Up @@ -30,7 +30,7 @@ void ParameterPair::setValue(const size_t value)
this->valueDouble = static_cast<double>(value);
}

std::string ParameterPair::getName() const
const std::string& ParameterPair::getName() const
{
return name;
}
Expand Down
6 changes: 3 additions & 3 deletions source/api/parameter_pair.h
Expand Up @@ -6,7 +6,7 @@
#include <cstddef>
#include <iostream>
#include <string>
#include "ktt_platform.h"
#include <ktt_platform.h>

namespace ktt
{
Expand Down Expand Up @@ -42,11 +42,11 @@ class KTT_API ParameterPair
*/
void setValue(const size_t value);

/** @fn std::string getName() const
/** @fn const std::string& getName() const
* Returns name of a parameter.
* @return Name of a parameter.
*/
std::string getName() const;
const std::string& getName() const;

/** @fn size_t getValue() const
* Returns integer representation of parameter value.
Expand Down
10 changes: 5 additions & 5 deletions source/api/platform_info.cpp
@@ -1,4 +1,4 @@
#include "platform_info.h"
#include <api/platform_info.h>

namespace ktt
{
Expand All @@ -13,22 +13,22 @@ PlatformIndex PlatformInfo::getId() const
return id;
}

std::string PlatformInfo::getName() const
const std::string& PlatformInfo::getName() const
{
return name;
}

std::string PlatformInfo::getVendor() const
const std::string& PlatformInfo::getVendor() const
{
return vendor;
}

std::string PlatformInfo::getVersion() const
const std::string& PlatformInfo::getVersion() const
{
return version;
}

std::string PlatformInfo::getExtensions() const
const std::string& PlatformInfo::getExtensions() const
{
return extensions;
}
Expand Down
20 changes: 10 additions & 10 deletions source/api/platform_info.h
Expand Up @@ -5,8 +5,8 @@

#include <iostream>
#include <string>
#include "ktt_platform.h"
#include "ktt_types.h"
#include <ktt_platform.h>
#include <ktt_types.h>

namespace ktt
{
Expand All @@ -30,29 +30,29 @@ class KTT_API PlatformInfo
*/
PlatformIndex getId() const;

/** @fn std::string getName() const
/** @fn const std::string& getName() const
* Getter for name of platform retrieved from compute API.
* @return Name of platform retrieved from compute API.
*/
std::string getName() const;
const std::string& getName() const;

/** @fn std::string getVendor() const
/** @fn const std::string& getVendor() const
* Getter for name of platform vendor retrieved from compute API.
* @return Name of platform vendor retrieved from compute API.
*/
std::string getVendor() const;
const std::string& getVendor() const;

/** @fn std::string getVersion() const
/** @fn const std::string& getVersion() const
* Getter for platform version retrieved from compute API.
* @return Platform version retrieved from compute API.
*/
std::string getVersion() const;
const std::string& getVersion() const;

/** @fn std::string getExtensions() const
/** @fn const std::string& getExtensions() const
* Getter for list of supported platform extensions retrieved from compute API.
* @return List of supported platform extensions retrieved from compute API.
*/
std::string getExtensions() const;
const std::string& getExtensions() const;

/** @fn void setVendor(const std::string& vendor)
* Setter for name of platform vendor.
Expand Down
4 changes: 2 additions & 2 deletions source/api/reference_class.h
Expand Up @@ -3,7 +3,7 @@
*/
#pragma once

#include "ktt_types.h"
#include <ktt_types.h>

namespace ktt
{
Expand All @@ -29,7 +29,7 @@ class ReferenceClass

/** @fn virtual void* getData(const ArgumentId id) = 0
* Returns pointer to buffer containing reference output for specified kernel argument. This method will be called only after running
* computeResult() method. It can be called multiple times for same kernel argument. Inheriting class must provide implementation for this
* computeResult() method. It can be called multiple times for the same kernel argument. Inheriting class must provide implementation for this
* method.
* @param id Id of kernel argument for which reference output will be retrieved. This can be used by inheriting class to support validation of
* multiple kernel arguments.
Expand Down
2 changes: 1 addition & 1 deletion source/api/stop_condition/configuration_count.h
Expand Up @@ -4,7 +4,7 @@
#pragma once

#include <algorithm>
#include "stop_condition.h"
#include <api/stop_condition/stop_condition.h>

namespace ktt
{
Expand Down
2 changes: 1 addition & 1 deletion source/api/stop_condition/configuration_duration.h
Expand Up @@ -5,7 +5,7 @@

#include <algorithm>
#include <limits>
#include "stop_condition.h"
#include <api/stop_condition/stop_condition.h>

namespace ktt
{
Expand Down
2 changes: 1 addition & 1 deletion source/api/stop_condition/configuration_fraction.h
Expand Up @@ -4,7 +4,7 @@
#pragma once

#include <algorithm>
#include "stop_condition.h"
#include <api/stop_condition/stop_condition.h>

namespace ktt
{
Expand Down
2 changes: 1 addition & 1 deletion source/api/stop_condition/tuning_duration.h
Expand Up @@ -5,7 +5,7 @@

#include <algorithm>
#include <chrono>
#include "stop_condition.h"
#include <api/stop_condition/stop_condition.h>

namespace ktt
{
Expand Down
4 changes: 2 additions & 2 deletions source/api/tuning_manipulator.cpp
@@ -1,5 +1,5 @@
#include "tuning_manipulator.h"
#include "tuning_runner/manipulator_interface.h"
#include <api/tuning_manipulator.h>
#include <tuning_runner/manipulator_interface.h>

namespace ktt
{
Expand Down
8 changes: 4 additions & 4 deletions source/api/tuning_manipulator.h
Expand Up @@ -6,10 +6,10 @@
#include <cstddef>
#include <utility>
#include <vector>
#include "ktt_platform.h"
#include "ktt_types.h"
#include "api/dimension_vector.h"
#include "api/parameter_pair.h"
#include <api/dimension_vector.h>
#include <api/parameter_pair.h>
#include <ktt_platform.h>
#include <ktt_types.h>

namespace ktt
{
Expand Down
16 changes: 8 additions & 8 deletions source/compute_engine/compute_engine.h
Expand Up @@ -3,14 +3,14 @@
#include <ostream>
#include <string>
#include <vector>
#include "ktt_types.h"
#include "api/device_info.h"
#include "api/output_descriptor.h"
#include "api/platform_info.h"
#include "dto/kernel_result.h"
#include "dto/kernel_runtime_data.h"
#include "enum/global_size_type.h"
#include "kernel_argument/kernel_argument.h"
#include <api/device_info.h>
#include <api/output_descriptor.h>
#include <api/platform_info.h>
#include <dto/kernel_result.h>
#include <dto/kernel_runtime_data.h>
#include <enum/global_size_type.h>
#include <kernel_argument/kernel_argument.h>
#include <ktt_types.h>

namespace ktt
{
Expand Down

0 comments on commit ff5f232

Please sign in to comment.