Answer:
The literary device that is used in this extract is SIMILIE.
Step-by-step explanation:
A similie is a comparison that becomes explicit by the use of the words "like" or "as". In this case, the tree (the memory of the tree) is compared to a spike and to an artillery piece, and the comparison is evident because of the use of the word "as".
"[The tree] loomed in my memory as a huge lone spike dominating the riverbank, forbidding as an artillery piece."