Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
25910a7a
There was an error fetching the commit references. Please try again later.
Commit
25910a7a
authored
5 years ago
by
Lukas Cejka
Committed by
Tomáš Oberhuber
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Initial commit
parent
74ce83d0
No related branches found
No related tags found
1 merge request
!45
Matrices revision
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/TNL/Exceptions/HostBadAlloc.h
+39
-0
39 additions, 0 deletions
src/TNL/Exceptions/HostBadAlloc.h
with
39 additions
and
0 deletions
src/TNL/Exceptions/HostBadAlloc.h
0 → 100644
+
39
−
0
View file @
25910a7a
/***************************************************************************
HostBadAlloc.h - description
-------------------
begin : Apr 17, 2019
copyright : (C) 2017 by Tomas Oberhuber et al.
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/* See Copyright Notice in tnl/Copyright */
// Implemented by: Lukas Cejka
#pragma once
#include
<new>
namespace
TNL
{
namespace
Exceptions
{
struct
HostBadAlloc
:
public
std
::
bad_alloc
{
HostBadAlloc
()
{
// Assert that there is enough space to store the values.
// TNL_ASSERT( Devices::SystemInfo::getFreeMemory() > Matrices::Matrix::getNumberOfMatrixElements() * sizeof( Matrices::Matrix::RealType ), );
std
::
cerr
<<
"terminate called after throwing an instance of 'TNL::Exceptions::HostBadAlloc'
\n
what(): "
<<
what
()
<<
std
::
endl
;
std
::
exit
(
1
);
}
const
char
*
what
()
const
throw
()
{
return
"Failed to allocate memory on the Host device: "
"most likely there is not enough space in the host memory."
;
}
};
}
// namespace Exceptions
}
// namespace TNL
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment