-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9255199
commit 90dda90
Showing
50 changed files
with
570 additions
and
554 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
* Edinburgh Soft Matter and Statistical Physics and | ||
* Edinburgh Parallel Computing Centre | ||
* | ||
* (c) 2010-2022 The University of Edinburgh | ||
* (c) 2010-2024 The University of Edinburgh | ||
* | ||
* Contributing authors: | ||
* Kevin Stratford ([email protected]) | ||
|
@@ -216,18 +216,18 @@ __host__ int cs_init(cs_t * cs) { | |
|
||
/* Device side */ | ||
|
||
tdpGetDeviceCount(&ndevice); | ||
tdpAssert( tdpGetDeviceCount(&ndevice) ); | ||
|
||
if (ndevice == 0) { | ||
cs->target = cs; | ||
} | ||
else { | ||
cs_param_t * tmp; | ||
tdpMalloc((void **) &cs->target, sizeof(cs_t)); | ||
tdpMemset(cs->target, 0, sizeof(cs_t)); | ||
tdpAssert( tdpMalloc((void **) &cs->target, sizeof(cs_t)) ); | ||
tdpAssert( tdpMemset(cs->target, 0, sizeof(cs_t)) ); | ||
tdpGetSymbolAddress((void **) &tmp, tdpSymbol(const_param)); | ||
tdpMemcpy(&cs->target->param, (const void *) &tmp, sizeof(cs_param_t *), | ||
tdpMemcpyHostToDevice); | ||
tdpAssert( tdpMemcpy(&cs->target->param, (const void *) &tmp, | ||
sizeof(cs_param_t *), tdpMemcpyHostToDevice) ); | ||
cs_commit(cs); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ | |
* Edinburgh Soft Matter and Statistical Physics Group and | ||
* Edinburgh Parallel Computing Centre | ||
* | ||
* (c) 2013-2023 The University of Edinburgh | ||
* (c) 2013-2024 The University of Edinburgh | ||
* | ||
* Contributing authors: | ||
* Oliver Henrich ([email protected]) | ||
|
@@ -120,7 +120,7 @@ __host__ int fe_electro_create(pe_t * pe, psi_t * psi, fe_electro_t ** pobj) { | |
fe->super.func = &fe_electro_hvt; | ||
fe->super.id = FE_ELECTRO; | ||
|
||
tdpGetDeviceCount(&ndevice); | ||
tdpAssert( tdpGetDeviceCount(&ndevice) ); | ||
|
||
if (ndevice == 0) { | ||
fe->target = fe; | ||
|
@@ -131,7 +131,7 @@ __host__ int fe_electro_create(pe_t * pe, psi_t * psi, fe_electro_t ** pobj) { | |
fe_vt_t * vt = NULL; | ||
|
||
tdpAssert(tdpMalloc((void **) &fe->target, sizeof(fe_electro_t))); | ||
tdpMemset(fe->target, 0, sizeof(fe_electro_t)); | ||
tdpAssert( tdpMemset(fe->target, 0, sizeof(fe_electro_t)) ); | ||
|
||
tdpGetSymbolAddress((void **) &vt, tdpSymbol(fe_electro_dvt)); | ||
tdpAssert(tdpMemcpy(&fe->target->super.func, &vt, sizeof(fe_vt_t *), | ||
|
@@ -155,7 +155,7 @@ __host__ int fe_electro_free(fe_electro_t * fe) { | |
|
||
assert(fe); | ||
|
||
tdpGetDeviceCount(&ndevice); | ||
tdpAssert( tdpGetDeviceCount(&ndevice) ); | ||
if (ndevice > 0) tdpAssert(tdpFree(fe->target)); | ||
|
||
if (fe->mu_ref) free(fe->mu_ref); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
* Edinburgh Soft Matter and Statistical Physics Group and | ||
* Edinburgh Parallel Computing Centre | ||
* | ||
* (c) 2013-2018 The University of Edinburgh | ||
* (c) 2013-2024 The University of Edinburgh | ||
* | ||
* Contributing authors: | ||
* Kevin Stratford ([email protected]) | ||
|
@@ -138,7 +138,7 @@ __host__ int fe_es_create(pe_t * pe, cs_t * cs, fe_symm_t * symm, | |
psi_nk(psi, &fe->param->nk); | ||
fe_es_epsilon_set(fe, psi->epsilon, psi->epsilon2); | ||
|
||
tdpGetDeviceCount(&ndevice); | ||
tdpAssert( tdpGetDeviceCount(&ndevice) ); | ||
|
||
if (ndevice == 0) { | ||
fe->target = fe; | ||
|
@@ -147,10 +147,10 @@ __host__ int fe_es_create(pe_t * pe, cs_t * cs, fe_symm_t * symm, | |
fe_vt_t * vt; | ||
fe_es_param_t * tmp; | ||
|
||
tdpMalloc((void **) &fe->target, sizeof(fe_es_t)); | ||
tdpAssert( tdpMalloc((void **) &fe->target, sizeof(fe_es_t)) ); | ||
tdpGetSymbolAddress((void **) &tmp, tdpSymbol(const_param)); | ||
tdpMemcpy(&fe->target->param, tmp, sizeof(fe_es_param_t *), | ||
tdpMemcpyHostToDevice); | ||
tdpAssert( tdpMemcpy(&fe->target->param, tmp, sizeof(fe_es_param_t *), | ||
tdpMemcpyHostToDevice) ); | ||
tdpGetSymbolAddress((void **) &vt, tdpSymbol(fe_es_dvt)); | ||
} | ||
|
||
|
@@ -169,7 +169,7 @@ __host__ int fe_es_free(fe_es_t * fe) { | |
|
||
assert(fe); | ||
|
||
if (fe->target != fe) tdpFree(fe->target); | ||
if (fe->target != fe) tdpAssert( tdpFree(fe->target) ); | ||
|
||
free(fe->param); | ||
free(fe); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
* Edinburgh Soft Matter and Statistical Physics Group | ||
* and Edinburgh Parallel Computing Centre | ||
* | ||
* (c) 2022 The University of Edinburgh | ||
* (c) 2022-2024 The University of Edinburgh | ||
* | ||
* Contributing authors: | ||
* Kevin Stratford ([email protected]) | ||
|
@@ -79,7 +79,7 @@ __host__ int fe_null_create(pe_t * pe, fe_null_t ** p) { | |
|
||
/* Allocate target memory, or alias */ | ||
|
||
tdpGetDeviceCount(&ndevice); | ||
tdpAssert( tdpGetDeviceCount(&ndevice) ); | ||
|
||
if (ndevice == 0) { | ||
fe->target = fe; | ||
|
@@ -112,9 +112,9 @@ __host__ int fe_null_free(fe_null_t * fe) { | |
|
||
assert(fe); | ||
|
||
tdpGetDeviceCount(&ndevice); | ||
tdpAssert( tdpGetDeviceCount(&ndevice) ); | ||
|
||
if (ndevice > 0) tdpFree(fe->target); | ||
if (ndevice > 0) tdpAssert( tdpFree(fe->target) ); | ||
free(fe); | ||
|
||
return 0; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
* Edinburgh Soft Matter and Statistical Physics Group | ||
* and Edinburgh Parallel Computing Centre | ||
* | ||
* (c) 2019-2021 The University of Edinburgh | ||
* (c) 2019-2024 The University of Edinburgh | ||
* | ||
* Contributing authors: | ||
* Shan Chen ([email protected]) | ||
|
@@ -111,7 +111,7 @@ int fe_ternary_create(pe_t * pe, cs_t * cs, field_t * phi, | |
|
||
/* Allocate target memory, or alias */ | ||
|
||
tdpGetDeviceCount(&ndevice); | ||
tdpAssert( tdpGetDeviceCount(&ndevice) ); | ||
|
||
if (ndevice == 0) { | ||
obj->target = obj; | ||
|
@@ -163,7 +163,7 @@ __host__ int fe_ternary_free(fe_ternary_t * fe) { | |
|
||
assert(fe); | ||
|
||
tdpGetDeviceCount(&ndevice); | ||
tdpAssert( tdpGetDeviceCount(&ndevice) ); | ||
if (ndevice > 0) tdpAssert(tdpFree(fe->target)); | ||
|
||
free(fe->param); | ||
|
Oops, something went wrong.