Skip to content

Commit

Permalink
Add -timeout <Seconds> option to overwrite the default if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
kasaurov committed Jul 14, 2015
1 parent e82217d commit 4791c0c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/hexl/hexl_exe/HexlRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ int HexlRunner::ParseOptions()
optReg.RegisterOption("match");
optReg.RegisterOption("testlog");
optReg.RegisterOption("rtlib");
optReg.RegisterOption("timeout");
int n;
if ((n = hexl::ParseOptions(argc, argv, optReg, options)) != 0) {
std::cout << "Invalid option: " << argv[n] << std::endl;
Expand Down
8 changes: 4 additions & 4 deletions src/hexl/hexl_hsaruntime/HsailRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ void HsaQueueErrorCallback(hsa_status_t status, hsa_queue_t *source, void *data)
HostThreads hostThreads;
std::vector<std::string> keys;

const static uint32_t TIMEOUT = 120;
const uint32_t TIMEOUT;

public:
HsailRuntimeContextState(HsailRuntimeContext* runtime_, Context* context_)
: runtime(runtime_), context(context_), hostThreads(this) { }
HsailRuntimeContextState(HsailRuntimeContext* runtime_, Context* context_, uint32_t timeout)
: runtime(runtime_), context(context_), hostThreads(this), TIMEOUT(timeout) { }

~HsailRuntimeContextState()
{
Expand Down Expand Up @@ -998,7 +998,7 @@ HsailRuntimeContext::HsailRuntimeContext(Context* context)
runtime::RuntimeState* HsailRuntimeContext::NewState(Context* context)
{
this->context = context;
return new HsailRuntimeContextState(this, context);
return new HsailRuntimeContextState(this, context, context->Opts()->GetUnsigned("timeout", HSAILRUNTIMEDEFAULTTIMEOUT));
}

void HsailRuntimeContext::QueueDestroy()
Expand Down
2 changes: 2 additions & 0 deletions src/hexl/hexl_hsaruntime/HsailRuntime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "HSAILBrigContainer.h"
#include <functional>

#define HSAILRUNTIMEDEFAULTTIMEOUT 120

namespace hexl {

class EnvContext;
Expand Down
1 change: 1 addition & 0 deletions src/hsail_conformance/exe/HsailConformanceRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ void HCRunner::Run()
optReg.RegisterBooleanOption("dump.dispatchsetup");
optReg.RegisterBooleanOption("XtestFtzF16"); // eXperimental
optReg.RegisterOption("match");
optReg.RegisterOption("timeout");
{
int n = hexl::ParseOptions(argc, argv, optReg, options);
if (n != 0) {
Expand Down

0 comments on commit 4791c0c

Please sign in to comment.